开发者

Saving multiple files through xcopy in a batch file

开发者 https://www.devze.com 2022-12-26 17:58 出处:网络
When I use the following code in command prompt, it works fine. But when I use the same code in a batch file, nothing happens. My batch file simply consists of:

When I use the following code in command prompt, it works fine. But when I use the same code in a batch file, nothing happens. My batch file simply consists of:

for %f in (D:\f开发者_C百科lexcube1,D:\flexcube2,D:\flexcube3) do xcopy %f D:\o\ /e  

but it does not work. I don't understand it and I have to use a batch file to copy multiple files. Any help would be really appreciated.


You need to use two % signs in for commands in a batch script (I know, who would have thought?)

for %%f in (D:\flexcube1,D:\flexcube2,D:\flexcube3) do xcopy %%f D:\o\ /e
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号