i am trying to build script to automate the building of config files for a
network traffic monitoring app using the run method of wsh - but i think i
am running into an issue with double quotes that are used to specify a
working directory in the command line i am trying to run in my script.
the following is my simple test script:
set ws = WScript.CreateObject("WScript.shell")
ws.run ("perl
cfgmaker --ifref=descr --ifdesc=alias --no-down --descint --subdirs=HOSTNAME
sn...@192.168.1.101 --global "Workdir: C:\Inetpub\wwwroot\mrtg" --output
test2620.cfg")
(except that sn...@192.168.1.101 is not actually a hyperlink - but my current
editor refuses to believe me...)
anyway, when i run this i get a message stating that a ")" is expected at on
line 2 at char 122 - after the beginning of the "Workdir... portion of the
command. i can understand that the second set of quotes in the command would
cause a problem, but i can't get past this point. can someone please tell me
how to remedy this script? i'm sorry, but i don't have a grasp on how wsh
reads spaces and double quotes just yet.
thank you for any help...nick
> set ws = WScript.CreateObject("WScript.shell")
> ws.run ("perl
> cfgmaker --ifref=descr --ifdesc=alias --no-down --descint --subdirs=HOSTNAME
> sn...@192.168.1.101 --global "Workdir: C:\Inetpub\wwwroot\mrtg" --output
> test2620.cfg")
>
> (except that sn...@192.168.1.101 is not actually a hyperlink - but my current
> editor refuses to believe me...)
>
> anyway, when i run this i get a message stating that a ")" is expected at on
> line 2 at char 122 - after the beginning of the "Workdir... portion of the
> command. i can understand that the second set of quotes in the command would
> cause a problem, but i can't get past this point. can someone please tell me
> how to remedy this script? i'm sorry, but i don't have a grasp on how wsh
> reads spaces and double quotes just yet.
Try this:
change
"Workdir: C:\Inetpub\wwwroot\mrtg"
to
""Workdir: C:\Inetpub\wwwroot\mrtg""
--
torgeir
thank you!...that was the key
nick
"Torgeir Bakken" <Torgeir.B...@hydro.com> wrote in message
news:3C8D634D...@hydro.com...