Windows 7: cmd.exe: setting startup directory (in a link to cmd.exe)

cmd, directory, windows, windows-7

Solution

as mentioned by the other posters already: the regular approach is to edit the shortcut's properties and fill the field labled "start in". simple as that.

however, for some reason this has no effect on UAC enabled systems if at the same time you also enable the "run as administrator" checkbox in the advanced properties of the shortcut.

a solution is to put everything in the "target" field of the shortcut:

%windir%\System32\cmd.exe /K cd /d "E:\My Folder" & sometest.bat

when running on 64bit and you want to explicitly start the 32bit flavour of the command prompt:

%windir%\SysWOW64\cmd.exe /K cd /d "E:\My Folder" & sometest.bat

for additional information on the command line parameters used above see: `cmd.exe /?` `cd.exe /?`

Problem

I am running Windows 7 and when I run cmd.exe I want it to start up in a directory named C:\foo\bar. I remember being able to create a link to this executable on the desktop and right clicking somewhere to set the startup menu of the cmd.exe command prompt by filling out a field in a transient window, but I cannot find it. I have found the following argument which however seems more complicated. I want to set the startup directory for cmd.exe via a popup window. Changing default startup directory for command prompt in Windows 7 Any ideas?

Original source

Related problems