I am trying to create a SendTo shortcut to a batch script that will take the selected files (in this case, jpg's), zip them with 7zip and name them the folder name (that the selected files are in) and place them in the same folder. The directory names have spaces in them too. I am real close but have hit a stump..
Here's what I've got so far..
@echo off
set folder=%~dp1
if exist "%folder%- Photos.zip" del "%folder%- Photos.zip"
"C:\Program Files\7-Zip\7z" a -mx9 -tzip "%folder%- Photos.zip" "%~dp1*.jpg"
pause
It is doing just about everything I want, except not naming the zip file right. It always ends up "- Photos.zip" in the directory that I want.
Any help? Thanks in advance..
You are just specifying
C:\folder\ - Photos.zip
but you wantC:\folder\folder - Photos.zip
Try this to get the folder and filename prefix separately:
Couldn't try this because my tablet does not have a dosbox ;-)
Then 7z this way:
If you want to debug this, you should add
and investigate that file later on.