%%A was unexpected at this time

前端 未结 3 411
时光说笑
时光说笑 2020-12-08 18:22

I want to zip a folder containing files. So inorder to do that i need to loop through the entire file list and execute 7za command. (7zip command line version)



        
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 19:07

    If you are doing it from the command line, you don't have to escape the %, so %a is sufficient. You only need to use %%a from batch files.

    Also, you wanna be selecting the files instead of executing "G:\Files Sample\zip\txt\*.txt" as a command, which is what the /f switch does in combination with single quotes. The full command would be: for %A in ("G:\Files Sample\zip\txt\*.txt") do 7za -tzip "%A.zip" "%A"

提交回复
热议问题