How can I launch powershell.exe with the “default” colours from the PowerShell shortcut?

前端 未结 9 1367
野趣味
野趣味 2020-12-13 06:56

I\'m attached to the nice blue colour of the PowerShell window when you launch it from one of the pre-installed shortcuts. However, if you manually launch powershell.exe, yo

9条回答
  •  醉酒成梦
    2020-12-13 07:16

    Launch powershell with default blue and white colors in current folder from Explore or Total Commander or Double Commander on Windows 7 Pro 64-bit:

    1. Star Menu -> search PowerShell link -> right click on it -> Properties -> Shortcut tab (the one that opens by default) -> modify Start in: -> %CD%

    1. Create a batch file named ps.bat somewhere in a folder that is on the system PATH (if you do not have such a folder just make one, let's say C:\run\cli and add it to the PATH system environment variable). This batch file has to contain the following command:

      start "" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows PowerShell\Windows PowerShell.lnk"

    That's it. Now just type ps in the Explorer's path bar where the current folder is shown or in the command line box of Total Commander or Double Commander, etc...

    On Windows 10, there is no need to modify the PowerShell shortcut from Start Menu and the ps.bat file from above may contain just the following command:

    start %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
    

提交回复
热议问题