Computing.Net > Forums > Programming > Blank Spaces in cmd

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Blank Spaces in cmd

Reply to Message Icon

Name: Eoin
Date: March 16, 2006 at 07:08:23 Pacific
OS: WinXp
CPU/Ram: 512
Product: Dell
Comment:

I want to call a file path in cmd.exe that contains blank spaces
C:\Program Files\MyTxtFiles\*.txt

Surrounding this path in quotation marks does not work, I think because of *.txt I need the path to be as above. Any ideas how I can get over this?



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: March 16, 2006 at 07:27:10 Pacific
Reply:

What are you trying to achieve?

Cmd.exe is the NT command interpreter/processor, i.e. it "executes" commands typed at prompt. Commands are stored in files, but paths are not executable, so what you type has no meaning at all.


0

Response Number 2
Name: Eoin
Date: March 16, 2006 at 07:44:43 Pacific
Reply:

I have a batch file in which %1 is determined by the path typed in cmd following the call to the batch file

MyBat "C:\Program Files\MyTxtFiles\*.txt"
is what I type in cmd.exe but this results in a "system cannot find the specified files" error. Any suggestions?


0

Response Number 3
Name: IVO
Date: March 16, 2006 at 08:31:19 Pacific
Reply:

If so, you have to type as the parameter for the batch the short format of the path, i.e the old 8.3 name that can be obtained typing Dir /X. As rule it is made up from the first six characters followed by ~n e.g. Program Files becomes Progra~1 and so on.

The batch if not specifically coded does not recognize names embraced by "".


0

Response Number 4
Name: Eoin
Date: March 16, 2006 at 11:12:00 Pacific
Reply:

Many Thanks IVO. That works great.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Blank Spaces in cmd

trimming spaces in a string www.computing.net/answers/programming/trimming-spaces-in-a-string/1025.html

Blank space within an array www.computing.net/answers/programming/blank-space-within-an-array/8553.html

Replace blank spaces with ; in a tx www.computing.net/answers/programming/replace-blank-spaces-with-in-a-tx/13192.html