I usually have one rule when I extract an archived folder. When I open the zipped folder, if there is ONLY ONE folder in there, then I always "Extract here". If there's a more than one, or anything else, then I extract to "sub".
Is it possible to create a script, command or button that will do that for me? In other words, it will look in the archive, and extract one way if true, and extract the other way if false? That way, I don't have to open and look first, but instead just click it and it will determine that for me.
If it's possible and simple, is there anyone that can write it? I don't know how to write scripts, I just always use what I find here
I haven't tried this with these particular commands, but you might be able to get simple error checking by adding the copy and delete via cmd.AddLine, then running them as a single command via cmd.Run. If the copy fails, the delete shouldn't happen.
But I'd still be careful using a button like that, as "fail" means the command had to be aborted entirely, which will exclude cases where, say, you accidentally click Skip All when you meant to click Replace or Abort, and then nothing is extracted and the archive is deleted... Or antivirus might see a new file and tell you it deleted it, and then the archive also gets deleted...
I much prefer to do the two steps separately, making the extraction leave the archives selected (which lxp's script already does) so I can then click Delete afterwards when/if that's what I want, while staying in full control of what happens, for just one extra click.
Both of you guys's responses have made me think. I guess I hadn't thought about the different scenarios since there is no error checking. I will heed your advice and not add the commands. I can definitely see any of those scenarios occur.
Thank you guys, this is truly the best community out there. I've been using this button since it was posted nad it has saved me TONS of time. Thanks again both of you for your input.