Good day,
Im trying to create a script that runs a command line with an argument the
problem is that the argument has space in side it, and im having trouble
working out the command line, here is the command with the argument:

Set WshShell = WScript.CreateObject("WScript.Shell")
rCommand = "runas /user:Domain\suorenz "mmc
%windir%\system32\management.msc"'
WshShell.Run rCommand, 0, TRUE

Thanks in advance

--
Oren Zippori
eAladdin.com

Re: Space inside a command line. by neo

neo
Sun Aug 15 11:30:44 CDT 2004

Have you tried dropping the "mmc" part and just go with the msc part?

eg.

rCommand = "runas /u:domain\user %windir%\system32\management.msc"

"Oren Zippori" <orenzp@hotmail.com> wrote in message
news:%23puwXOugEHA.3548@TK2MSFTNGP09.phx.gbl...
> Good day,
> Im trying to create a script that runs a command line with an argument the
> problem is that the argument has space in side it, and im having trouble
> working out the command line, here is the command with the argument:
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
> rCommand = "runas /user:Domain\suorenz "mmc
> %windir%\system32\management.msc"'
> WshShell.Run rCommand, 0, TRUE
>
> Thanks in advance
>
> --
> Oren Zippori
> eAladdin.com
>
>



Re: Space inside a command line. by Torgeir

Torgeir
Sun Aug 15 13:05:23 CDT 2004

Oren Zippori wrote:

> Good day,
> Im trying to create a script that runs a command line with an argument the
> problem is that the argument has space in side it, and im having trouble
> working out the command line, here is the command with the argument:
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
> rCommand = "runas /user:Domain\suorenz "mmc
> %windir%\system32\management.msc"'
> WshShell.Run rCommand, 0, TRUE
>
> Thanks in advance
>
Hi

Inside a quoted string, you will need to use two quotes to get
one effective:

Set WshShell = CreateObject("WScript.Shell")
sCmd = "runas /user:Domain\suorenz ""mmc %windir%\system32\management.msc"""
WshShell.Run sCmd, 0, True


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Space inside a command line. by Oren

Oren
Tue Aug 17 00:05:35 CDT 2004

Thanks Torgeir
your answer helped me.

Oren

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:O5e3FKvgEHA.3320@TK2MSFTNGP11.phx.gbl...
> Oren Zippori wrote:
>
> > Good day,
> > Im trying to create a script that runs a command line with an argument
the
> > problem is that the argument has space in side it, and im having trouble
> > working out the command line, here is the command with the argument:
> >
> > Set WshShell = WScript.CreateObject("WScript.Shell")
> > rCommand = "runas /user:Domain\suorenz "mmc
> > %windir%\system32\management.msc"'
> > WshShell.Run rCommand, 0, TRUE
> >
> > Thanks in advance
> >
> Hi
>
> Inside a quoted string, you will need to use two quotes to get
> one effective:
>
> Set WshShell = CreateObject("WScript.Shell")
> sCmd = "runas /user:Domain\suorenz ""mmc
%windir%\system32\management.msc"""
> WshShell.Run sCmd, 0, True
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx