ConfigMgr Failing to Run Vbscript
I’ve had a vbscript that I wrote for setting a registry key that has been causing me problems today. It’s a pretty simple script…just writing a DWORD value to HKLM to disable the backup notification in the Windows 7 Action Center. The script works fine in my testing…both running as an admin and running as Local System. I had already deployed the script to numerous computers in a pilot group, and the advertisement status was reporting that the script was completing successfully. Then I got a call saying that the notification was still showing up. I checked the machine, and the registry entry was not there…even though the script ran successfully.
After beating on it for a while I discovered the problem…the 64 bit redirection is getting in the way. In a nutshell, if a 32bit program attempts to write to certain sections of the registry, the registry call is redirected to HKLM\Software\Wow6432Node instead. This is essentially the “32 bit section” of the registry. In this instance, the script is being run by the ConfigMgr client…which is a 32bit program. The script was completing successfully…writing to the Wow6432Node instead of where I needed it to write. I did a ton of research to try to find a way around it from within the script, but was unable to figure out how to do it from within the script. However…there is a way to accomplish what I am wanting to do in ConfigMgr…
- Set up a Custom Task Sequence and use a “Run Command Line” step.
- Point that step to use the ConfigMgr package containing your script.
- The command line should be “cscript.exe scriptname.vbs” (without the quotes of course)
- Ensure that the checkbox for “Disable 64-bit file system redirection” is checked.
- Advertise that Task Sequence to the computers that you need it to run on.
After doing that, it worked like a charm.