>> Rodney Roberts IS & Education Professional Homepage






Science makes it known,
Engineering makes it work,
Art makes it beautiful.


 

WinXP Command Prompt Path


On occasion, in Windows XP it is necessary to run a program in a Command Prompt, specifying full path names.

(Short file names also work in a Win7 Command Prompt)

For example, let's say you need to run a java class from a Command Prompt. It will be necessary to specify the -classpath parameter to java.exe. And java.exe does not like embedded blanks in directory names - it treats them as the end of the -classpath. Screenshot below illustrates this:



As can be seen, the -classpath would be
C:\Documents and Settings\Rodney Roberts\My Documents\JCreator LE\MyProjects\dfGUI\classes
(this is a long file name)

This can be shortened to:
C:\Docume~1\Rodney~1\MyDocu~1\JCreat~1\MyProj~1\dfGUI\classes
(this is a short file name, each portion is 8 characters or less)

For each directory (oops, should I say folder?) and subdirectory name, replace characters 7 through last with '~1'*. This is mandatory for directories with blanks in the name, optional for directories with 7 or more characters in its name.

Thus, the Command Prompt changes from this (an already customized Command Prompt):
Command Prompt with long file names

To this:
Command Prompt with short file names
using
cd C:\Docume~1\Rodney~1\MyDocu~1\JCreat~1\MyProj~1

This is a leftover from the introduction of long file names in Win95.


* On some occasions, instead of using the substitute characters '~1' for characters 7 - last,
it may be necessary to use '~2', '~3', etc. Using the above example,
C:\Docume~1\Rodney~1\MyDocu~1\JCreat~1\MyProj~2\dfGUI\classes
Note that MyProj~1 is now MyProj~2.



Any and all copyrights, trademarks, or other intellectual property mentioned here are the property of their respective owners.
Site best viewed with Internet Explorer 5.x (or higher) and Mozilla FireFox 1.0.2 (or higher) (FireFox is preferred).
Free Web Hosting Provided By   Free Hosting


>> Rodney Roberts IS & Education Professional Homepage