For long i have used a shortcut file to open command prompt in current working directory, like this:
SHORTCUT.lnk /k cd /d %P
where .lnk file just open "C:\Windows\System32\cmd.exe".
Now with Powershell beeing dominant in my work, i like to do just the same, only now with Powershell prompt?
So far i came up following, but it only opens powershell and 'verbosing' the correct current directory, but the actual directory is still
<PS C:\windows\system32> :
command = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit
syntax = -command "'%P'"
[Solved] Open Powershell (prompt) from current directory - and elevated rights
Moderators: white, Hacker, petermad, Stefan2
[Solved] Open Powershell (prompt) from current directory - and elevated rights
Last edited by dungn on 2019-05-15, 13:42 UTC, edited 1 time in total.
Re: Open Powershell (prompt) from current directory
I don't know it is sufficient for you, but I use the Start menu in Total Commander
Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Parameters: -noexit -command "cd '%p'"
The command needs to be surrounded by double quotes " and %p by single quotes '
br /ola
Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Parameters: -noexit -command "cd '%p'"
The command needs to be surrounded by double quotes " and %p by single quotes '
br /ola
Re: Open Powershell (prompt) from current directory
Just launch PowerShell.exe, TC will do the rest and ask PS to change to the path of the current active panel.
Code: Select all
Command = powershell -NoExit
Parameters =
Start path =
Icon file = powershell
Tooltip = Launch PS in current path
Ready to paste button:
Code: Select all
TOTALCMD#BAR#DATA
powershell -NoExit
powershell
Launch PS in current path
-1
Re: Open Powershell (prompt) from current directory
O-m-goodness. The simplest solution is often the genius one. Thank you "Stefan2".Just launch PowerShell.exe, TC will do the rest and ask PS to change to the path of the current active panel.
And actually, my full question was how to open Powershell with elevated rights also. Thank you "obeg", you proved the best answer for my problem:
-noexit -command "cd '%p'"
Last edited by dungn on 2019-05-15, 13:36 UTC, edited 1 time in total.
Re: Open Powershell (prompt) from current directory
Open the button for modifying > click [Help] and read:
Command: ................
1. You may specify ...........
.............. Put an asterisk '*' in front of the name to start it with administrative rights,
Command = *powershell -NoExit
Parameters =
Start path =
Icon file = powershell
Tooltip = Launch PS in current path as Admin
HTH?
Re: Open Powershell (prompt) from current directory
Thank you again Stefan2. I did not know that also.
Luving Total Commander since Windows Commander....
Luving Total Commander since Windows Commander....