Page 1 of 1 1
Topic Options
#9424 - 2001-06-11 09:22 PM running quotes within a SHELL command
Anonymous
Unregistered


I need to run the following command, but getting confused as to how to add quotes within the command:

shell "%comspec% /e:1024 /c k:\aj\print\netsvc" +" "spooler""+" \\" +@wksta+" /stop"

What I want to do is to run the above command as follows:

netsvc "spooler" \\phn939 /stop
(were phn939 is computer name)
The script keeps comfusing the quotes I use for the spooler service

Top
#9425 - 2001-06-11 10:13 PM Re: running quotes within a SHELL command
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hey cyber,

Yeah - the shell command and double quotes screwed me up for the longest time. Then I made myself a rule of thumb that keeps me out of trouble...

Always wrap the (entire) shell command in single-quotes, then you're free to use double-quotes inside the command

Like this ...

shell '%comspec% /e:1024 /c k:\aj\print\netsvc "spooler" \\@wksta /stop'

-Shawn

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1110 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.05 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org