Open Powershell in a specific directory from shortcut
This sounds like it should be so simple... I must be dumb.
All I want is to make a windows short-cut that opens Powershell into a specific directory:
I'm using the target:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
-noexit -command {cd c:/path/to/open}
Put it just spits out the command as text.
Solution 1:
Use this command.
powershell.exe -noexit -command "cd c:\temp"
-NoExit
: Do not exit after running startup commands.
Solution 2:
You can also set the "Start in" shortcut field to your desired location.
Solution 3:
Ok - you need to use the &
parameter to specify it's a powershell comand & the syntax is slightly different:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
-noexit -command "& {cd c:\path\to\open}"
Solution 4:
Define a Shortcut for Powershell, and Open the properties of that, and finally in "Start" type the folder target to be opened when Powershell Shortcut is triggered