Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 352
Dave Bish Avatar asked Jan 09 '13 10:01

Dave Bish


People also ask

What is the shortcut to open PowerShell?

Launch Task Manager: a quick way is to simultaneously press the Ctrl + Shift + Esc keys on your keyboard. If the Task Manager opens up in its compact mode, click or tap on "More details." Then, open the File menu and click or tap on "Run new task." In the "Create new task" window, type powershell and press Enter or OK.

How do I jump to a directory in PowerShell?

Open a PowerShell prompt by clicking Start and type PowerShell. In the search results, click Windows PowerShell. In the PowerShell console, type Move-Item –Path c:\testfolder -Destination c:\temp and press ENTER.


1 Answers

Use this command.

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

-NoExit: Do not exit after running startup commands.

like image 65
Loïc MICHEL Avatar answered Sep 27 '22 23:09

Loïc MICHEL