Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command line - filenames with spaces, other woes 3

Status
Not open for further replies.

itsme213

Technical User
Jan 30, 2004
26
0
0
US
OK, I must be totally dumb.

I'm using the standard built-in "command" line.

I type in:
cd "C:\Program Files"
and I get
Parameter format not correct.

I try all kinds of other combinations, no luck.

How does this work?

Is there any filename completion thingie available?

Thanks.
 
2 Rules in DOS:

- If a Filename has a space, ignore it. (e.g. "Road ME.exe" becomes "ROADME.exe")
- If a filename has more than 8 characters, only type the first 6 characters followed by "~#".

Example:

In a folder there is:
- Pooisgreat 1.exe
- pooisgreat 2.exe
- poo 3.exe

These become:
- POOISG~1.EXE
- POOISG~2.EXE
- POO3.EXE


So in your case, type "C:\Progra~1
 
If you use CMD as your command processor (start/run/CMD) then you just type:
cd c:\program files
and put in the spaces and it works.

That doesn't work if you use command.com as your command interpreter.

If you want to use the ~ method, you can find out what the ~ version of the file name is by using dir <filespec> /X which will show you what the 8,3 version of the filename is - useful if you have a lot of similarly named files in a folder.

Jock
 
Good thinking DragonQ0105! Something that could help with this is to get a list of all the file names in the format that DragonQ0105 suggested with the command:
Code:
dir /x

X
 
Thanks, JockMullin.

I did not even know there was a "cmd", having always used "command". Looks like "cmd" even has filename completion.

Oooooh. Why didn't I ask this question a year ago!

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top