Sometimes, you want to restart the Windows explorer
. This is already an exception case which you want to do when explorer hangs (for instance when taskbar icons do not respond any more), or has files locked which need to be modified. I described the latter in Inno Setup: Program Folder not showing up In Start > All Programs , with this very simple restart script:
taskkill /F /IM explorer.exe
start explorer
Even more exception is wanting to run explorer
with a UAC elevated administrative token. I sometimes do this when moving around stuff from other users on the same computer without having them logged on (as that would lock the files or directories to be moved around).
The risk of running explorer under UAC elevation, is that any program you start will also start UAC elevated, so beware what you ask for…
This is how you start explorer under UAC elevation:
pwsh.exe -nol -noni -nop -w hidden -c "taskkill /f /im explorer.exe; start explorer -v runas -a /nouaccheck"
or if you run an older Windows version of PowerShell:
PowerShell.exe -nol -noni -nop -w hidden -c "taskkill /f /im explorer.exe; start explorer -v runas -a /nouaccheck"
These command-line options and verbs are used:
Time to explain a few:
Read the rest of this entry »
Like this:
Like Loading...