Script fails remediation but works when on success
I have a script that verifies if a directory is there, if it is it unzips a shortcut to that location then delete the folder it came from. If the directory is not there I have it create the directory and then unzip the folder then delete the folder it came from.
The first part works if the directory is there it will unzip the file, copy the shortcut then delete the folder. However, if the directory is not there I am able to create the folder but when I try to unzip the folder and copy the shortcut it fails. I am unsure why because it works if the folder is there and I am able to create the folder.
Is there a better way to organize this? I can add more screenshots if needed.
Any help is much appreciated, thanks.
Answers (2)
Did you check wait for completion box for all the tasks? Especially for the batch file that is remediation step one. If you did not, it side calls the window to run the batch and moves on to the next step and if the batch is not done failure!
Comments:
-
The way I would do that is zip the excel.lnk file up and upload that zip to the script, under success create run a batch file task and use:
If exist c:\VMGApps then goto copyit else goto makedir
:makedir
mkdir c:\VMGApps
:copyit
xcopy $(KACE_DEPENDENCY_DIR)\excel.lnk c:\VMGApps /q /t - SMal.tmcc 5 years ago