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.
Answer Chosen by the Author
Made a separate script to verify the folder and create one if its missing.