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?
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:
I've never seen this particular issue, but you can sort out file associations with Group Policy Preferences. Either:
or
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:
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.
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.
http://www.nilpo.com/2009/07/windows-xp/restoring-vbs-vbscript-script-file-file-associations/
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).