post #1 of 1
Thread Starter 
Anyone Familiar with Server 2003 Logon scripts? the code im using for my script is visual basic but im having errors with my script and i was wondering if an expert eye could spot any errors in my code

Thanks for any help=)


The Script is as follows:

'

Dim objNetworkold, objNetworkold2, strUNCPrinterold, strUNCPrinterold2

strUNCPrinterold = "\\\\GRADED\\Brothermd1"

strUNCPrinterold2 = "\\\\GRADED\\Brothergeneral1md"

Set objNetworkold = CreateObject("WScript.Network")
' Section which removes the network printer
objNetworkold.RemovePrinterConnection strUNCPrinterold

Set objNetworkold2 = CreateObject("WScript.Network")
' Section which removes the network printer
objNetworkold2.RemovePrinterConnection strUNCPrinterold2




Dim objNetworknew, objNetworknew2, strUNCPrinternew

Set objNetworknew = CreateObject("WScript.Network")
objNetworknew.AddWindowsPrinterConnection "\\\\allan-yeeh1nfqi\\Brothermd1"

Set objNetworknew2 = CreateObject("WScript.Network")
objNetworknew2.AddWindowsPrinterConnection "\\\\allan-yeeh1nfqi\\Brothergeneral1md"

strUNCPrinternew = "\\\\allan-yeeh1nfqi\\Brothermd1"
Set objNetworknew = CreateObject("WScript.Network")
objNetworknew.AddWindowsPrinterConnection strUNCPrinternew
objNetworknew.SetDefaultPrinter strUNCPrinternew






Dim objNetworkdrive
Dim strDriveLetter, strRemotePath

strDriveLetter = "J:"
strRemotePath = "\\\\allan-yeeh1nfqi\\Root Shared Directory"

' Purpose of script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result J: drive
Set objNetworkrive = CreateObject("WScript.Network")

objNetworkdrive.MapNetworkDrive strDriveLetter, strRemotePath




WScript.Quit
    
CPUMotherboardGraphicsRAM
Core 2 Quad Q6600 @3.2Ghz Asus P5N-T Deluxe 2x BFG 8800GTS 640 SLi 4GB Crucial Ballistix Tracer Pc8500 
Hard DriveOSMonitorPower
750GB Xp Pro/Vista x64 Ultimate dual boot 19" Philips Widescreen 750w Silverstone Modular 
Case
Cm690 Dominator 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core 2 Quad Q6600 @3.2Ghz Asus P5N-T Deluxe 2x BFG 8800GTS 640 SLi 4GB Crucial Ballistix Tracer Pc8500 
Hard DriveOSMonitorPower
750GB Xp Pro/Vista x64 Ultimate dual boot 19" Philips Widescreen 750w Silverstone Modular 
Case
Cm690 Dominator 
  hide details  
Reply