Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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)


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.

share|improve this answer

It appears Windows server 2008 still defaults to wscript $1 as the default action for the vbsfile type, so perhaps this was a local change that can be reversed.

Can you change the GPO policy for the login script to run a command line instead of the script directly? Something like:

wscript ourlogin.vbs
share|improve this answer

Sounds like your clients need their default action for VB Script files to be changed from open with Notepad.exe to open with Cscript.exe or Wscript.exe.

The following url provides registry files to reset this. The XP reg file matches my XP registry. You'll need to check on the Vista and W7 files.

You might want to check out why someone changed this setting on the clients - This is a secure setting, and changing it may violate a policy, or may be set back by whatever set it this way in the first place (GPO, AV client, etc).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.