2011-06-08 62 views
1

在Windows XP中,我希望它将与模式selenium*.jar匹配的唯一文件复制到本地目录。在Windows批处理脚本中复制文件时出现问题

我曾尝试:

其中
pushd \\remote.mydomain.com\selenium\ 
FOR %f IN (selenium*.jar) DO copy %f C:\selenium 

\\remote.mydomain.com是一个共享目录,其内容在远程服务器上托管。

但我得到的错误:

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

回答

2

替换%f在你的脚本%%f%f仅在直接在命令提示符处输入命令但不在批处理文件中时起作用。然后在命令行键入help for向您显示第二段中描述此行为的手册。