Help with a drop bat.

Dell / Dimension 4600i...
December 20, 2010 at 18:20:41
Specs: Microsoft Windows XP Home Edition, 2.793 GHz / 1534 MB
I could use a bit of help.

It's a drop bat...drag and drop a file into the batch file.

echo file: %1
echo 7za a -t7z files.7z %1 >> temp.bat

What is created is
7za a -t7z files.7z G:\bats\zip.txt with a bat extension.

Runs and zips but with the name of files.7z

My question is ...How can I replace the files.z (the name of the zip file) with the name of the file. I need to chop off g:\bats\ in the name and leave it in the path.

So the created bat reads as 7za a -t7z zips.7z G:\bats\zip.txt

Hope someone has an idea.


See More: Help with a drop bat.

Report •

December 20, 2010 at 18:27:28
It won't read as "zips" but it will read as "zip" (filename without the extension or path).


7za a -t7z "%~n1.7z" "%~1"

More info:

call /?

Report •

December 20, 2010 at 19:09:50
You know what? Works perfectly!

Thank you

Report •
Related Solutions

Ask Question