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.

0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: welcometothe 1 year ago
Senior White Belt

Top Answer

Made a separate script to verify the folder and create one if its missing.

Posted by: SMal.tmcc 1 year ago
Red Belt

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!

  • 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

    mkdir c:\VMGApps

    xcopy $(KACE_DEPENDENCY_DIR)\excel.lnk c:\VMGApps /q /t - SMal.tmcc 1 year ago
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ