I have a few "Run Script" (Command Script) tasks that work without issues on Windows XP. I'm having problems running the same scripts on Windows 7.
Issue #1:
I have a script that changes the default background after boot from image deployment to let Tech imaging that the computer is being worked on by the DS. The script as follows maps a network drive and copies the wallpaper temp.bmp to C:. Then I have it run the command below.
REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d c:\temp.bmp /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
In Windows 7 the second line doesn't update immediately (known issue) so we force a reboot to apply the changes. This works perfect on XP. When I run the script on Windows 7 it completes the task without errors but never changes the registry key. I've tried using a *.bat that is copied over to C: via the Run Script task and start it using the command "start c:\wallchange.bat". I've done this with a *.cmd as well. When I open the task manager I can see cmd.exe running after the script runs. To veryfy the batch file work, I double click on the *.bat, located in C:, it makes the changes to the registry.
Issue #2:
As an alternative to Issue #1, I have a *.hta that displays the temp.bmp as a splash on the computer. I run it using the command "start /b mshta.exe c:\splash.hta" This works without problems in Windows XP but in Windows 7 it completes the task and reports no errors. If I open the task manager after running the scipt it shows the the process "mshta.exe" is running but the hta is not displayed. If I run the command locally on the computer it displays the the spash message.
ds-712316-sp1-windows-7-run-script-issues
I have a task to deploy 7-zip then I have a "Run Script" task that runs after installing 7-zip that to import a *.reg that contains the configuration settings for the right click context menu. The command "Run Script" runs is below.
regedit.exe /s z:\ZIP\7ZIPWIN7.reg
The file is copied over to C: and executed with the above command in the task. This works without issues on XP but in Windows 7 it runs through the script and reports no errors. The key is not imported.
What I have done in Windows 7 to try to make it work:
1. Disabled UAC.
2. Disabled the Firewall.
3. We have no AV installed during script execution.
4. Computer is not on a domain so no policies are applied.
5. I've also disabled Windows Defender.
I've tested all my scripts locally on the computer and execute fine. If I run them through the "Run Script" task, for Windows 7, then they complete without errors but has the issues mentioned above. The Windows 7 image is all vanilla except for the Windows updates it installed. I've hit a brick wall. Any help would be greatly appreciated.