Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2006, 10:20 AM   #1
forcerr
Newbie
 
Join Date: Mar 2006
Posts: 8
Rep Power: 0 forcerr is on a distinguished road
my logon script HELP

gives me an error, and doesnt link the printers in KS1 or KS2, any ideas??

error is... Expected: Next


HELLPPP!!!

' -- West Vew Primary School --
' Classroom Logon Script
' 1. Maps Network Drives
' 2. Maps Printers
' 3. Sets correct printer, according to keystage
'----------------------------------------------------------

Option Explicit
Dim objNetwork, Printer1, Printer2, Printer3, PrinterDriver1, PrinterDriver2, PrinterDriver3, Server, adsDomainGroups


'-- Setting Objects --
Set objNetwork = CreateObject("WScript.Network")
Set adsDomainGroups = GetObject("WinNT://" & domain)

'-- Read security group membership --
adsDomainGroups.Filter = Array("Group")
For Each adsGroup in adsDomainGroups
 Group = UCase(adsgroup.name)


'-- Removes the networked drives --
 On Error Resume Next
objNetwork.RemoveNetworkDrive "s:"
objNetwork.RemoveNetworkDrive "x:"



'-- Connects Printers --
Printer1 = "\\server\IT1"
Printer2 = "\\server\IR1600"
Printer3 = "\\server\KS1Printer"
PrinterDriver1 = "HP Laserjet 1300 PCL 5e"
PrinterDriver2 = "Canon iR1600-2000 PCL5e"
PrinterDriver3 = "Brother HL-1450 series"
objNetwork.AddWindowsPrinterConnection Printer1, PrinterDriver1
objNetwork.AddWindowsPrinterConnection Printer2, PrinterDriver2
objNetwork.AddWindowsPrinterConnection Printer3, PrinterDriver3

if group = UCASE("ks1") then
	objNetwork.SetDefaultPrinter Printer3
elseif group = UCASE("ks2") then
	objNetwork.SetDefaultPrinter Printer1
end if


'-- Maps Drives -- 
Server = "\\server"
objNetwork.MapNetworkDrive "s:", server & "\software"
objNetwork.MapNetworkDrive "x:", server & "\shared"


WScript.Quit
forcerr is offline   Reply With Quote
Old Mar 9th, 2006, 10:32 AM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
sounds like your FOR loop is missing a NEXT statement...
for reference: http://www.w3schools.com/vbscript/vbscript_looping.asp
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Mar 9th, 2006, 10:37 AM   #3
forcerr
Newbie
 
Join Date: Mar 2006
Posts: 8
Rep Power: 0 forcerr is on a distinguished road
Quote:
Originally Posted by Infinite Recursion
sounds like your FOR loop is missing a NEXT statement...
for reference: http://www.w3schools.com/vbscript/vbscript_looping.asp
what for loop??? sorry i'm not experienced with VB SCript at all
forcerr is offline   Reply With Quote
Old Mar 9th, 2006, 11:09 AM   #4
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
the for loop that you have in your code ofcourse :-P

this is your code
For Each adsGroup in adsDomainGroups
 Group = UCase(adsgroup.name)

this is what it should be:
For Each adsGroup in adsDomainGroups
 Group = UCase(adsgroup.name)
Next
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Mar 9th, 2006, 11:30 AM   #5
forcerr
Newbie
 
Join Date: Mar 2006
Posts: 8
Rep Power: 0 forcerr is on a distinguished road
ha, i didnt even see that, half asleep, long day...

now i get the error, variable is undefined 'domain', dont have a domain variable? :s
forcerr is offline   Reply With Quote
Old Mar 9th, 2006, 11:57 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Get some sleep .
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 9th, 2006, 12:39 PM   #7
jaspalmxtech
Newbie
 
jaspalmxtech's Avatar
 
Join Date: Oct 2005
Location: css ajax pear smarty php asp scripts web templates downloads jaspal forum http://www.aadhunik.com/
Posts: 3
Rep Power: 0 jaspalmxtech is on a distinguished road
must be missing something . . .
__________________
css ajax pear smarty php asp scripts web templates downloads jaspal forum http://www.aadhunik.com/
jaspalmxtech is offline   Reply With Quote
Old Mar 9th, 2006, 12:45 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
@ Mr. Singh:
Quote:
Originally Posted by Forum Rules
Signatures Rules:

1. NO images in signatures - Large flashing images in between every other sentence are the most annoying thing in the world, therefore absolutely NO images are allowed in forum signatures.

2. Maximum length - The maximum length of a forum signature is 4 to 5 lines.

3. Font size - Please don’t increase font size beyond the default text size.

4. Links - You may link to your site, but no affiliate, drug, pornographic, hacking, warez, or otherwise offensive links allowed.

5. Language - All forum signatures must be in English.
You might read the rules regarding spamming, also, though there is room for interpretation there.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 9th, 2006, 3:03 PM   #9
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Holy shit... could you reduce the font size on the name please?
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Mar 10th, 2006, 4:24 AM   #10
forcerr
Newbie
 
Join Date: Mar 2006
Posts: 8
Rep Power: 0 forcerr is on a distinguished road
dnt hi-jack my thread pls, pm's are for stuff like that, anyway can anyone see any problems coz i cnt???
forcerr is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:17 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC