Ignore percent sign in batch file

后端 未结 6 2386
北恋
北恋 2020-11-22 14:33

I have a batch file which moves files from one folder to another. The batch file is generated by another process.

Some of the files I need to move have the string \"

6条回答
  •  没有蜡笔的小新
    2020-11-22 14:57

    I think I've got a partial solution working. If you're only looking to transfer files that have the "%20" string in their name and not looking for a broader solution, you can make a second batch file call the first with %%2 as the second parameter. This way, when your program tries to fetch the second parameter when it hits the %2 in the text name, it will replace the %2 with an escaped %2, leaving the file name unchanged.

    Hope this works!

提交回复
热议问题