Changing the initial directory
If cmd.exe is started using this shortcut file, the initial directory is determined by the .lnk
file's property Start In.
The
property dialog, that shows the available propertes and their values, is opened by pressing
alt+enter
with the
.lnk
file selected in
explorer:
In this picture, the
Start In value is empty, thus when
cmd.exe
is started, its initial directory will be
C:\Windows\System32
.
This directory can obviously be changed by entering a new directory in the dialog box. However, it is also possible (and imho less error prone and less time consuming) to change the initial directory with
PowerShell):
$sh = new-object -com wScript.shell
$lnk = $sh.createShortcut("$env:appdata\Microsoft\Windows\Start Menu\Programs\Command Prompt.lnk")
$lnk.workingDirectory = '%homedrive%%homepath%'
$lnk.save()