Skip navigation

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'?

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

C:\Windows\system32\cmd.exe The directory name is invalid.

C:\Windows\system32\Notepad.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%, <Drive:>\FolderName, etc...

3. Press OK.



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