开发者

Trouble copying a file in a Windows batch script

In Windows XP, I want it to copy the only file matching the pattern, selenium*.jar to a local directory.

I have tried:

pushd \\remote.mydomain.com\selen开发者_开发技巧ium\
FOR %f IN (selenium*.jar) DO copy %f C:\selenium

in which \\remote.mydomain.com is a shared directory, whose contents are hosted on a remote server.

But I get the error:

C:\selenium>pushd \\remote.mydomain.com\selenium\
f was unexpected at this time.


Replace %f with %%f in your script. %fworks only if you entering the command directly at the command prompt, but not in a batch file. And typing help for on the command line shows you the manual where this behaviour is described in the second paragraph.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜