Stuart_C Posted September 10, 2013 Posted September 10, 2013 So the topic says it all, in order to minimise printer script maintenance I want to run one VB script from within another one. So essentially I'm using this Set WshShell = WScript.CreateObject( "WScript.Shell" ) Wshshell.run ("""c:\users\me\desktop\staff Printers.vbs""") Which all works nicely. However when I modify it to run on the netwotk to: Set WshShell = WScript.CreateObject( "WScript.Shell" ) Wshshell.run ("""\\\Sysvol\\scripts\printer\staff Printers.vbs""") it fails. As far as I can tell it's not running the script. Yet if I run \\\Sysvol\\scripts\printer\staff Printers.vbs manually on the PC it runs and does it's thing so I know it's not that the PC cant's see the file. And now I'm confused and I don't know whats up?
pleach85 Posted September 17, 2013 Posted September 17, 2013 I tend to set a variable DQ to chr(34) (Double Quotes) and then use that in the run command. Using """ caused me problems too! Set WshShell = WScript.CreateObject( "WScript.Shell" ) DQ = chr(34) Wshshell.run (DQ & "\\\Sysvol\\scripts\printer\staff Printers.vbs" & DQ)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now