Error 'the filename directory name or volume sytax is incorrect' with VB logon script
Posted on 2008-10-20
We currently have an office of about 30 computers setup in different OU's. I need to be able to have the computers in the different OU's print to a default printer in each OU and still have the ability to print anywhere in the office. Right now there is a total of 7 printers all on different computers with the printer shared. I have done much reading on the subject and here is what I have come up with. Now when I run this on any computer just as a file, it will map all of the printers just fine. However, if I throw this in the GP for the OU, on startup the computer will throw an error "the filename directory name or volume sytax is incorrect".
I know nothing about VB and this is the first time I have tried to use it. It seems odd to me that it would work fine just running the script, but it throws an error on startup. It also appears to be applying properly as it is running on startup. Any ideas would be great and here is the script I am using saved in the policies startup folder. Thanks in advance.
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\GIns2\GIns2-HP 6940"
net.AddWindowsPrinterConnection "\\GSur2\GSur2-HP C4380 series"
' Set the default printer now