![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2006
Posts: 8
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Mar 2006
Posts: 8
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() |
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! |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Mar 2006
Posts: 8
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#7 |
|
Newbie
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
![]() |
must be missing something . . .
__________________
css ajax pear smarty php asp scripts web templates downloads jaspal forum http://www.aadhunik.com/ |
|
|
|
|
|
#8 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
@ Mr. Singh:
Quote:
__________________
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 |
|
|
|
|
|
|
#9 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#10 |
|
Newbie
Join Date: Mar 2006
Posts: 8
Rep Power: 0
![]() |
dnt hi-jack my thread pls, pm's are for stuff like that, anyway can anyone see any problems coz i cnt???
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|