Moved the post to the right place and finished it
This commit is contained in:
parent
2c7077f4c8
commit
fceb23d9d0
26
content/blog/determine-default-script-host-2023.md
Normal file
26
content/blog/determine-default-script-host-2023.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
title: "How Can I Determine the Default Windows Script Host? (2023 edition)"
|
||||||
|
date: 2023-04-06T07:10:01Z
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
If you search for this topic today, you'll find [a post](https://devblogs.microsoft.com/scripting/how-can-i-determine-the-default-script-host-on-a-computer-before-i-run-a-script/) 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
|
||||||
|
|
||||||
|
![Screenshot of procmon](/images/procmon.png)
|
||||||
|
|
||||||
|
Et voilà!
|
||||||
|
|
||||||
|
Here's a PowerShell snippet for querying this value
|
||||||
|
```powershell
|
||||||
|
(Get-ItemProperty registry::HKEY_CLASSES_ROOT\VBSFile\Shell).'(Default)'
|
||||||
|
```
|
||||||
|
|
||||||
|
`Open` means WScript, `Open2` means CScript.
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Determine Default Script Host 2023"
|
|
||||||
date: 2023-04-06T07:10:01Z
|
|
||||||
draft: true
|
|
||||||
---
|
|
||||||
|
|
BIN
static/images/procmon.png
Normal file
BIN
static/images/procmon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
Reference in New Issue
Block a user