Solved

Error 'the filename directory name or volume sytax is incorrect' with VB logon script

Posted on 2008-10-20
6
311 Views
Last Modified: 2012-06-27
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.

Jordan

Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\GAd1\GAd1-HP6940"
net.AddWindowsPrinterConnection "\\GFO3\GFO3HP1000"
net.AddWindowsPrinterConnection "\\GIns2\GIns2-HP 6940"
net.AddWindowsPrinterConnection "\\GSur2\GSur2-HP C4380 series"
net.AddWindowsPrinterConnection "\\JDoc1\JDoc1-HP1115"
net.AddWindowsPrinterConnection "\\JWk1\JWK1-Brother"
net.AddWindowsPrinterConnection "\\JWk1\JWk1-HP"

' Set the default printer now
net.SetDefaultPrinter "\\GAd1\GAd1-HP6940"

0
Comment
  • 4
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Jerrod_W
Comment Utility
Two things to check first. Is the logon script located in the NETLOGON share? (silly question) is the file saved with a .vbs extension?
0
 

Author Comment

by:imperialcomputersolutions
Comment Utility
Umm well does it need to be in the NETLOGON share?  By default it seems its looking for it in a different folder.  When I added the GP to the container I wanted to apply it to and then hit 'edit computer configuration\windows settings\scripts (startup/shutdown)\startup script', and add my VB script it has a folder in server.local\policies\{B55...}\machine\scripts\startup.  

It seems to be finding the actual script as it does indeed run when the computer starts.  Do I still need to but it in the NETLOGON share as well as the share it looks for?  Thanks for the response.
0
 

Author Comment

by:imperialcomputersolutions
Comment Utility
And in answer to your other question, yes it is saved with a VBS extension.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 4

Expert Comment

by:Jerrod_W
Comment Utility
It doesn't need to be in the netlogon folder, its just the common folder for scripts on SBS. I would recommend trying to move the logon script to another folder and doing it that way.
0
 

Author Comment

by:imperialcomputersolutions
Comment Utility
Well I found out the reason that it was throwing me that error was because the script is being run on one of the computers where a printer is located.  If I delete the section of script for that computer, then it will run with no errors.  But it still is not actually applying any of the printer settings when a user logs into the computer.  I'm reading about loopback processing.  Is that what I need to do to the GPO?  Sorry if this all sounds confusing, but I have no idea how to use/setup scripts.
0
 

Accepted Solution

by:
imperialcomputersolutions earned 0 total points
Comment Utility
Alright, problem solved.  It seems that I just had the script in computer instead of user settings when editing the local policy.  After I moved it over it worked just fine.  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you are a user of the discontinued Microsoft Office Accounting 2008 (MSOA) and have to move to a new computer running Windows 8, you will be unhappy to discover that it won't install.  In particular, Microsoft SQL Server 2005 Express Edition (SSE…
You may have discovered the 'Compatibility View Settings' workaround for making your SBS 2008 Remote Web Workplace 'connect to a computer' section stops 'working around' after a Windows 10 client upgrade.  That can be fixed so it 'works around' agai…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now