Search code examples
powershellwindows-7shortcut

Open Powershell in a specific directory from shortcut


How can one make a windows short-cut that opens Powershell into a specific directory?

Such as the target:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe 
    -noexit -command {cd c:/path/to/open}

But that just spits out the command as text. How?


Solution

  • Use this command.

    powershell.exe -noexit -command "cd c:\temp"
    

    -NoExit: Do not exit after running startup commands.