Install Windows SysInternals like a Pro and Attract Romantic Propositions
The venerable Windows SysInternals Suite is perennially provided in an equally unflattering and flat zip file indiscriminately littered with executable tools and ersatz Compiled HTML HelpFiles (that's your handy-dandy *.chm for the uninitiated). One is left to install them as one sees fit, with no recommendations. I think there are reasonable guidelines we should expect and today I'll show you how I like to pack the pipe:
- Most of the SysInternals tools require Administrator rights to start or function properly. We should avoid having to right-click and hit Run As Administrator every time we go to use one.
- The executables should be stored in a sensible place
- The tools should be easy to access, by GUI and CLI
My solutions are as follows:
- Permanently install the SysInternals Suite applications and documentation to C:\Program Files\SysInternals\
- Mass-enable the Run as administrator Capability setting on those applications
- Create a SysInternals Start Menu subfolder for easy GUI access
- Mass-enable the Run (target) as administrator setting on all shortcuts contained therein (just for the sake of being thorough)
- Update the Windows Path Environment Variable to contain C:\Program Files\SysInternals\ so they may be called from the
cmd.exe orPowerShell command line directly
![[attachment-meObQY]](/files/2024/03/08/windows_addpath_thumb_300.jpg)
To these ends, my installation recipe simmers thus:
- Open
PowerShell as Administrator (right-click, Run as Administrator). Run the following:
mkdir "C:\Program Files\SysInternals" mkdir "C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\SysInternals" - Extract the
SysInternalsSuite.zip to C:\Program Files\SysInternals - Open C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\SysInternals in
File Explorer - In another
File Explorer window open C:\Program Files\SysInternals in Details View - Sort the folder's contents by File Type. Select all Application files (all files ending in *.exe)
- Using your right mouse button, drag the selected files over to the Start Menu entry's window. Choose Create Shortcuts from the context menu that opens when you release the right button.
- Open the System control panel
- Click on Advanced system settings (as shown in the illustration above)
- Click the Environment Variables... button at the bottom of the System Properties window
- Click on the PATH variable, then the Edit... button
- Click the New button on the Edit environment variable window
- Paste the path C:\Program Files\SysInternals into the new line that was created then click OK on each of the three open settings window to return to the Settings control panel, which you may now close
- Visit my article Use Windows PowerShell to Make Multiple Shortcuts Always Run their Target as Administrator and install the shortcutJS.bat shortcut editing script according to my instructions (note that setting the Run as administrator capability directly to multiple executable files is a substantially differentiated matter, covered by its own article - both methods will be employed here)
- Return to your existing - or open a new - Administrator session of PowerShell (right-click and select Run as Administrator) and run the following commands and scriptlets to finalize your installation
PS C:\Windows\system32>
cd "C:\Program Files\SysInternals" PS C:\Program Files\SysInternals> $files = Get-ChildItem ./ -Include *.exe; foreach ($f in $files) { $filename = $f.FullNamereg.exe } PS C:\Program Files\SysInternals>ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v $filename /t REG_SZ /d "RUNASADMIN" /f cd "C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\SysInternals" PS C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\SysInternals> $files = Get-ChildItem ./ -Include *.lnk; foreach ($f in $files) { $filename = $f.FullName shortcutJS.bat -edit $filename -adminpermissions yes }
![[attachment-LhhjUM]](/files/2024/03/08/windows_runasadmin_registry_thumb_300_2.jpg)