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"