I have a computer GPO set to run the following script upon boot:
If I run this script manually as an administrator, everything works as it should. If I run it manually as System via PSExec, it works. It doesn't run at all when I try to have it start at boot using a Computer GPO. GPresults show that the GPO was accepted, and there are no errors in the event logs, however the script is never actually run.
I'm all out of ideas here. Obviously the permissions in the shares are right or else I wouldn't have been able to run it manually as System. It's as though the computer looks at the script, goes "Meh..." and skips over it.
Code:
@echo Off
:Created: MArtin Mayr / 20130624
:purpose: Setup SAP GUI 7.30 and patches
if exist c:\SAPInstalled.txt goto end
echo SAP Install-started to %computername% on %date% %time% >> \\MI-NORFS01\temp$\SAPGUI\SAPInstalled.txt
: Install SAPGUI silent
\\MI-NORFS01\temp$\SAPGUI\11A00102\GUI\WINDOWS\WIN32\setup\NwSAPsetup.exe /package:"Gentherm Default Package" /silent
echo SAP Installed to %computername% on %date% %time% >> \\MI-NORFS01\temp$\SAPGUI\SAPInstalled.txt
: sapllogon.ini and saplogontree.xml must be in the program files folder to work properly
:set default SAP Location
set SAPGUI_folder="%ProgramFiles%\SAP\FrontEnd\SAPgui\"
:check for X64 machine destination folder
if exist "%ProgramFiles(x86)%\SAP\FrontEnd\SAPgui\" set SAPGUI_folder="%ProgramFiles(x86)%\SAP\FrontEnd\SAPgui\"
xcopy /y \\MI-NORFS01\temp$\SAPGUI\11A00102\_CONFIG\saplogon.ini %SAPGUI_folder%
rem xcopy /y \\MI-NORFS01\temp$\SAPGUI\11A00102\_CONFIG\saplogontree.xml %SAPGUI_folder%
rem delete saplogontree.xml because it causes issues
del %SAPGUI_folder%\saplogontree.xml
xcopy /y \\MI-NORFS01\temp$\SAPGUI\11A00102\_CONFIG\sapmsg.ini %SystemROOT%\
xcopy /y \\MI-NORFS01\temp$\SAPGUI\11A00102\_CONFIG\sapdoccd.ini %SystemROOT%\
:create links
xcopy /y "\\MI-NORFS01\temp$\SAPGUI\11A00102\_CONFIG\SAP Logon.lnk" "C:\Users\Public\Desktop\"
xcopy /y "\\MI-NORFS01\temp$\SAPGUI\11A00102\_CONFIG\SAP Logon.lnk" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\SAP Front End\"
xcopy /y "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\SAP Front End\" "C:\Users\Public\Desktop\"
echo SAP Installed >> C:\SAPInstalled.txt
:end
I'm all out of ideas here. Obviously the permissions in the shares are right or else I wouldn't have been able to run it manually as System. It's as though the computer looks at the script, goes "Meh..." and skips over it.