Scripting Question

Script fails remediation but works when on success

08/08/2019 513 views

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.

Answer Summary:
0 Comments   [ + ] Show comments


Answer Chosen by the Author


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

Answered 08/08/2019 by: welcometothe
Senior White Belt

All Answers


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!

Answered 08/08/2019 by: SMal.tmcc
Red Belt

  • 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
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