Inventory Windows startup commands across registry and profiles
Build a paste-ready command, then review its compatibility and effects before running it.
Get-CimInstance Win32_StartupCommand | Sort-Object Location,Name | Select-Object Name,Command,Location,User | Format-Table -Wrapread-onlyno known side effects Compatibility
WindowsVerified for Windows using powershell syntax.
Operational knowledgereview due 2027-01-19
RequirementsGet-CimInstanceGet-CimInstance must be installed and available on PATH.
Version supportGet-CimInstance Current supported releasesVerified for windows using powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsName Command Location UserRepresentative successful output; values vary with the selected target and system state.
Known errorsGet-CimInstance: command not foundGet-CimInstance is missing or is not available on PATH.
VerifyGet-CimInstance Win32_StartupCommand | Sort-Object Location,Name | Select-Object Name,Command,Location,User | Format-Table -WrapThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01Get-CimInstanceCommandRuns the Get-CimInstance stage of this one-liner.
02Win32_StartupCommandArgumentPasses Win32_StartupCommand to Get-CimInstance.
03|PipelinePasses the output on the left to the command on the right.
04Sort-ObjectCommandRuns the Sort-Object stage of this one-liner.
05Location,NameArgumentPasses Location,Name to Sort-Object.
06|PipelinePasses the output on the left to the command on the right.
07Select-ObjectCommandRuns the Select-Object stage of this one-liner.
08Name,Command,Location,UserArgumentPasses Name,Command,Location,User to Select-Object.
09|PipelinePasses the output on the left to the command on the right.
10Format-TableCommandRuns the Format-Table stage of this one-liner.
11-WrapOptionConfigures Format-Table with the -Wrap option.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
Get-CimInstance Win32_StartupCommand | Sort-Object Location,Name | Select-Object Name,Command,Location,User | Format-Table -Wrap
Example output
Name Command Location User
---- ------- -------- ----
OneDrive "C:\Program Files\Microsoft OneDrive\OneDrive.exe" HKU\...\Run DESKTOP\ada
Security C:\Program Files\Agent\agent.exe --startup HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run NT AUTHORITY\SYSTEM
Illustrative output — exact values vary by system and data.
Official sources