How Can I Determine the Default Windows Script Host? (2023 edition)
If you search for this topic today, you’ll find a post from 2006 on the “Scripting Guy” blog that contains some information on how to query the registry key to figure out the default scripting host. Great!
Except it’s wrong
To be fair to Scripting Guy, he was correct when he wrote that article, but the change in this behaviour is one of the lesser known exciting features of Windows Vista.
So, how does it work now?
Through the magic of procmon
, we can figure out what changes are taking place when we change the script host
Et voilĂ !
Here’s a PowerShell snippet for querying this value
1(Get-ItemProperty registry::HKEY_CLASSES_ROOT\VBSFile\Shell).'(Default)'
Open
means WScript, Open2
means CScript.