Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie - running a perl application from within WSH script? Run method question...

0 views
Skip to first unread message

Nick Leachman

unread,
Mar 11, 2002, 8:54:23 PM3/11/02
to
hi,

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


Torgeir Bakken

unread,
Mar 11, 2002, 9:09:18 PM3/11/02
to
Nick Leachman wrote:

> 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


Nick Leachman

unread,
Mar 12, 2002, 3:16:51 PM3/12/02
to
Torgeir,

thank you!...that was the key

nick

"Torgeir Bakken" <Torgeir.B...@hydro.com> wrote in message
news:3C8D634D...@hydro.com...

0 new messages