Enumerates all startup commands on a computer, including those found in the Startup folder and those found in the Registry.

This script was tested using Object REXX 2.1.0 for Microsoft Windows, available from IBM.

Object REXX
strComputer = "."
objWMIService = .OLEObject~GetObject("winmgmts:\\"||strComputer||"\root\CIMV2")
do objItem over objWMIService~ExecQuery("Select * from Win32_StartupCommand")
    say "Caption:" objItem~Caption
    say "Command:" objItem~Command
    say "Description:" objItem~Description
    say "Location:" objItem~Location
    say "Name:" objItem~Name
    say "Setting ID:" objItem~SettingID
    say "User:" objItem~User