我希望能够让脚本重命名正在使用的文件。
这可能吗?
这是我目前的脚本。 提前谢谢!
@echo off
Set FileSource=C:\temp\cleric
Set RemoteDestinationFolder=C:\program files (x86)\cleric
Set InputFile=c:\Test\Computers.txt
Set RemoteDestination=\\%%*\%RemoteDestinationFolder::=$%\
For /F "eol=;" %%* in ('type "%InputFile%"') do (
Ping.exe -n 2 -w 750 %%* | Find/i "TTL=" >Nul&&(
xcopy /Y/q/r/e "%FileSource%" "%RemoteDestination%")||(
echo.%%* "Computer was Not found">>%InputFile%.errors.log)
If Not ErrorLevel 0 echo.%%* "Copy was unsuccesfull">>%InputFile%.errors.log
(Set ErrorLevel=)
)
@echo.
Pause