Can I set PowerShell as 'default' in Windows 7?
I would like, by default, for PowerShell to be launched instead of Command when, say, running a batch file, or when I "Open Command Window Here", etc.
Any suggestions?
Solution 1:
I just did a very quick test and the following registry entry will add a "PowerShell here" item to the context menu of all folders in explorer:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\PowerShellHere]
@="&PowerShell here"
[HKEY_CLASSES_ROOT\Directory\shell\PowerShellHere\command]
@="cmd.exe /c start \"PS\" powershell.exe -NoExit -Command \"cd \\\"%1\\\"\""
Just import it into the registry.
I am using cmd.exe
to bootstrap powershell in order to avoid having to hard-code the path.
Regarding cmd scripts/batch files. I think it does not make much sense to run CMD scripts within PowerShell by default. But it might be possible as well by modifying HKCR\cmdfile\shell\open
registry key