command line completion bug when filename starts with "["

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

- create a file named [a].txt
- open command prompt
- goto the directory where [a].txt resides
- type "[" character and use autocompletion to have expanded the rest
of the name
Instead of completing to [a].txt, it will expand to ["[a].txt"

Best regards,
Calin
 
File and directory name completion correctly processes file names that
contain white space or special characters if you place quotation marks
around the matching path.

The following special characters require quotation marks: & < > [ ] { } ^ =
; ! ' + , ` ~ [white space]

Paste the following line into the Start | Run box and click OK...

hh ntcmds.chm::/Cmd.htm

or see..

Cmd
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx

just above the formatting legend.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Thanks, it's interesting. What about "con", why can't I create a directory
called "con" as in
md con
?

Best regards,
Calin


Wesley Vogel said:
File and directory name completion correctly processes file names that
contain white space or special characters if you place quotation marks
around the matching path.

The following special characters require quotation marks: & < > [ ] { } ^ =
; ! ' + , ` ~ [white space]

Paste the following line into the Start | Run box and click OK...

hh ntcmds.chm::/Cmd.htm

or see..

Cmd
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx

just above the formatting legend.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Calin Iaru said:
Hi all,

- create a file named [a].txt
- open command prompt
- goto the directory where [a].txt resides
- type "[" character and use autocompletion to have expanded the rest
of the name
Instead of completing to [a].txt, it will expand to ["[a].txt"

Best regards,
Calin
 
Because "con" is a reserved device name short for "console" - which is
normally where the output is sent, which in turn is sent to your video
card/monitor for you to see. It is also where the mouse/keyboard input is
sent to control the PC. For example - open a cmd window and type "copy con
myfile.txt", type in "Hello <enter>", <CTL><SHIFT><Z><enter> and you'll
get 1 file copied. Enter a "type myfile.txt" and you should see myfile has
the word "Hello" in it. Back in the old days, before we had edlin, edit and
other editors, that is how we built files such as "config.sys" and
"autoexec.bat" - if you messed up, you started over - but we've made
progress since then.

--

Star Fleet Admiral Q @ your service!
Google is your friend!
http://www.google.com


Calin Iaru said:
Thanks, it's interesting. What about "con", why can't I create a directory
called "con" as in
md con
?

Best regards,
Calin


Wesley Vogel said:
File and directory name completion correctly processes file names that
contain white space or special characters if you place quotation marks
around the matching path.

The following special characters require quotation marks: & < > [ ] { } ^
=
; ! ' + , ` ~ [white space]

Paste the following line into the Start | Run box and click OK...

hh ntcmds.chm::/Cmd.htm

or see..

Cmd
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx

just above the formatting legend.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Calin Iaru said:
Hi all,

- create a file named [a].txt
- open command prompt
- goto the directory where [a].txt resides
- type "[" character and use autocompletion to have expanded the
rest
of the name
Instead of completing to [a].txt, it will expand to ["[a].txt"

Best regards,
Calin
 
Calin said:
Thanks, it's interesting. What about "con", why can't I create a directory
called "con" as in
md con
?

Best regards,
Calin


:

File and directory name completion correctly processes file names that
contain white space or special characters if you place quotation marks
around the matching path.

The following special characters require quotation marks: & < > [ ] { } ^ =
; ! ' + , ` ~ [white space]

Paste the following line into the Start | Run box and click OK...

hh ntcmds.chm::/Cmd.htm

or see..

Cmd
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx

just above the formatting legend.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Calin Iaru said:
Hi all,

- create a file named [a].txt
- open command prompt
- goto the directory where [a].txt resides
- type "[" character and use autocompletion to have expanded the rest
of the name
Instead of completing to [a].txt, it will expand to ["[a].txt"

Best regards,
Calin

Con is a reserved name.
 
Also...

Reserved Names (reserved device names)

[[Do not use the following reserved device names for the name of a file:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these
names followed by an extension, for example, NUL.tx7.

Windows NT: CLOCK$ is also a reserved device name. ]]
from...
Naming a File
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Calin Iaru said:
Thanks, it's interesting. What about "con", why can't I create a directory
called "con" as in
md con
?

Best regards,
Calin


Wesley Vogel said:
File and directory name completion correctly processes file names that
contain white space or special characters if you place quotation marks
around the matching path.

The following special characters require quotation marks: & < > [ ] { }
^ = ; ! ' + , ` ~ [white space]

Paste the following line into the Start | Run box and click OK...

hh ntcmds.chm::/Cmd.htm

or see..

Cmd
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx

just above the formatting legend.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Calin Iaru said:
Hi all,

- create a file named [a].txt
- open command prompt
- goto the directory where [a].txt resides
- type "[" character and use autocompletion to have expanded the
rest of the name
Instead of completing to [a].txt, it will expand to ["[a].txt"

Best regards,
Calin
 
Back
Top