Page 1 of 1 1
Topic Options
#33738 - 2002-11-29 09:56 PM Run command
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
This is probably really easy and Im just overlooking some little detail...But how do you run somethin using the %comspec% variable that has spaces?

Example...

RUN "%COMSPEC% /c SUBST W: %userprofile%"

Trying to subst W: to the user's profile path...But since its Win2000 the profile path has spaces in it. If I try enclosing the %userprofile% in quotes then it ends the RUN command after RUN "%COMSPEC% /c SUBST W: " which also doesnt work too well.

Any help would be greatly appreciated...

-Shane

Top
#33739 - 2002-11-29 09:58 PM Re: Run command
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There's a FAQ on that.

Try:

RUN '%COMSPEC% /c SUBST W: "%userprofile%"'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#33740 - 2002-11-29 10:03 PM Re: Run command
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
That worked great...Thanks for the very fast response. I will try harder to find the answer myself next time.

-Shane

Top
#33741 - 2002-11-29 10:21 PM Re: Run command
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You should also read the FAQ about the differences between RUN and SHELL.
_________________________
There are two types of vessels, submarines and targets.

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 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.031 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