for
gives you the ability to extract (and combine) various parts from the loop variable (taken from help for
):
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
(truncated)
The modifiers can be combined to get compound results: %~dpI - expands %I to a drive letter and path only %~nxI - expands %I to a file name and extension only (truncated)
So you could use 7za a "C:\butemp\%%~nxi.7z" "%%i"
Run help for
for more options