I'm after a script that will extract a zip file and to the same folder and then then delete the zip file it just extracted.
I've done some pretty basic scripts, no one of them with more than 4 lines, so this is clearly out of my expertise.
OK so this is in detail what i want it to do.
1.- I will select "test.zip" file.
2.- The script will extract the selected "test.zip" file to the same folder.
3.- the script will delete the "test.zip" (or better yet, send it to the recycle bin)
I have the 7-Zip program installed on my machine. I was planing on using the "7zG.exe" file. Something like "7zG.exe e <Zip File>"
Can some one point me in the right direction. Or do something for me that could do this so i can understand how it works and adapt it.
For those without 7-Zip installed here's the Help File
Thank you in advance to all taking the time to read this.
Help With Script Involving 7-Zip.
Re: Help With Script Involving 7-Zip.
I don't have 7z and I haven't tested this, so use with care and test it first, but I think something like this should do it (once you're put the correct path to your 7zG.exe of course) :
Code: Select all
run """C:\Program Files\7z\7zG.exe"" x ""<curitem>""",,1; // launch extraction and waits until its over
delete 1, 0, <curitem>; // sends to recycle bin
Proud XYplorer Fanatic
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Help With Script Involving 7-Zip.
Yup, Jacky's script will work. But if your archive content is not within a folder then the contents will be extracted outside. To make sure that your content is always inside a folder, use this.
You can also use 7z.exe instead of 7zG.exe for command prompt styled extraction.
Code: Select all
//Extract archive contents inside a folder and delete archive
run """C:\Program Files\7-Zip\7zG.exe"" x -y -o* -aot ""<curitem>""",,1;
delete 1, 0, <curitem>;
Re: Help With Script Involving 7-Zip.
That worked. Thanks to both of you for that.
I was trying to get something like this to work but my script was already like five command lines long. Needless to say that it wasn't working. On the other hand people like you come around and achieve the same result with so little code.....
Thanks again
I was trying to get something like this to work but my script was already like five command lines long. Needless to say that it wasn't working. On the other hand people like you come around and achieve the same result with so little code.....
Thanks again