JSI Tip 7833. When you use RunAs to launch CMD.EXE or NotePad.exe in Windows XP or Windows Server 2003, you receive 'The directory name is invalid'?

Jerold Schulman

March 14, 2004

1 Min Read
ITPro Today logo in a gray background | ITPro Today

When you use the RunAs feature to launch CMD.exe or NotePad.exe, you receive one of the following:

C:Windowssystem32cmd.exe The directory name is invalid.

C:Windowssystem32Notepad.exe The directory name is invalid.

If the Start in is set to %HOMEDRIVE%%HOMEPATH%, you will experience this behavior, as these operating systems prohibit using RunAs to access the logged-on users mapped home drive. Windows XP and Windows Server 2003 treat the two instances of the same user name as two different local users.

To workaround this behavior:

1. Right-click Command Prompt or Notepad in the Accessories folder of your start menu (and any other place you launch from) and press Properties.

2. Change the Start in value from %HOMEDRIVE%%HOMEPATH% to a system-wide (non-user) value, like %SystemRoot%, %WinDir%, FolderName, etc...

3. Press OK.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like