View Single Post
Old 03-28-2015, 11:13 AM   #45
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,566
Karma: 79436716
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Just to explain a few things

for /r says scan the current directory and all sub directories
"%1" ensures that if the matched file name contains spaces there are no issues
%~p1 extracts the directory name
%~n1 extracts just the file name (with no path or extension)

AH... I could have simplified
Code:
for /r %1 in (*.original_epub) do 7za a "%~p1""%~n1".7z "%1"
to
Code:
for /r %1 in (*.original_epub) do 7za a "%~pn1".7z "%1"

Last edited by PeterT; 03-28-2015 at 11:16 AM.
PeterT is offline   Reply With Quote