Skip navigation

I am unable to use Start from the command line with files with spaces in.

A. A. The Windows NT Start command allows the user to create separate window/process to run a specified program. If you try and run something that consists of a long file name with a space in quotes if fails and just brings up an empty cmd.exe window, e.g.

C:\> start "d:\documents\ntfaq book\contents.doc"

fails. In order to make it work only the part that has the long name should be in quotes, e.g.

C:\> start d:\documents\"ntfaq book"\contents.doc

will work OK. This applies to anything such as a server, share etc, e.g.

C:\> start \\"<server with space>"\"<share with space>"\"<dir with space>"\"<file with space>"
e.g. C:\> start \\"johns server"\"docs share"\"ntfaq dir"\"table of contents.doc"

This is basically down to the fact that the first item in quotes should be the title of the window, and so a better way to work round the problem is to use

C:\> start "" "d:\documents\ntfaq book\contents.doc"

which will now work fine and there can be as many spaces as you want in any part.


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish