recursion - Command Line For Loop returns path that is missing last subdirectory -
i'm trying use loop recursively extract zip files in folder multiple levels , zips within zips. when run error message because last sub directory blank looks c:\users\johnsmith\desktop\testing\\ , says cannot create output directory. had thought had had working earlier guess missed something. , help!
here i'm running:
for /r "c:\users\johnsmith\desktop\testing\" %i in (*.zip) (7z x "%i" -aou -o\"%~dpi\" && del \"%~fi\")
i guess there \"
survivals of escaping sequences in command if call within program. no such need (and harmful) in pure cmd
.
as per 7-zip command line version user's guide use -o"%~dpi"
(remove backslashes); same in del "%~fi"
follows
for /r "c:\users\johnsmith\desktop\testing\" %i in (*.zip) (7z x "%i" -aou -o"%~dpi" && del "%~fi")
Comments
Post a Comment