VBScript gets opened in text editor instead of being executed

group-policyvbscriptwindows-registrywindows-server-2008

I'm part of a Windows Server 2008 domain. There's a login script (supposedly configured to execute on login via GPO) that sets permissions for network shares. However, instead of being executed, it's opening in my text editor. I presume that there's been a registry change that affects the default shell ("double click") action for .vbs, and that Windows Server 2008, or possibly this particular GPO, assumes that the default shell action is "execute". Is there a way to fix this locally? Is there a way to fix the GPO to explicitly pass the script to the Windows script host instead?

Best Answer

I've never seen this particular issue, but you can sort out file associations with Group Policy Preferences. Either:

Computer Config -> Preferences -> Control Panel Settings -> Folder Options

(Right Click -> New File Type)

or

User Config -> Preferences -> Control Panel Settings -> Folder Options

(Right Click -> New Open With)

Computer config gives you full configuration options similar to manually changing it in Folder Options on the machine. User config just gives you an "Execute" option which you can set as default.

Computer config would be the preferred - just go onto a working machine and duplicate the settings. I think this would work for you, but you'll need to experiment:

enter image description here

Alternatively, as @uSlackr, run it as a batch script and call the VBS. Though that's more a workaround rather than a fix in my opinion.