MS Office Fixlet Problems

Hello, everyone!

I am having problems with a Microsoft Office C2R task. The task creates the necessary XML file and a batch script to run the installation. It will only run if a user is logged in. The problem is, the final clean up (the deletion of the script and xml) runs before the install has a chance to begin. This means that the “pause while {exists running application “cmd.exe”}” and “pause while {exists running application “OfficeClickToRun.exe”}” never get the opportunity to pause the action script. Is there anything I can do about this? Should I make this a baseline and do the clean up afterwards? I’m open to any and all suggestions. Another question is… Can this C2R installation run without a user logged in? Thanks in advance!

prefetch RunAsCurrentuser.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

//Checking for old files and removing them
if {exists file “__createfile”}
delete __createfile
endif

if {exists file “O365.xml”}
delete O365.xml
endif

if {exists file “deployOffice.bat”}
delete deployOffice.bat
endif

//Creating XML for MS Office build
createfile until xmlfile









xmlfile

//Copying XML to root of C:
copy __createfile O365.xml
copy O365.xml c:\O365.xml

//Creating bat file to launch installation
createfile until batfile
net use \PATH\Storage PASSWORD /USER:USERNAME
\PATH\Storage\Apps\bigfix.O365ProPlusRetail.2016\setup.exe /configure C:\O365.xml
batfile

//Copying script to root of C:
copy __createfile deployOffice.bat
copy deployOffice.bat c:\deployOffice.bat

//Waiting for a user to log in
pause while {not exists current user}

waithidden __Download\RunAsCurrentUser.exe “{pathname of system folder & “\cmd.exe”}” /Q /C C:\deployOffice.bat

//Waiting for C2R to finish installing
pause while {exists running application “cmd.exe”}
pause while {exists running application “OfficeClickToRun.exe”}

//Clean up
delete c:\O365.xml
delete c:\deployOffice.bat

restart