Batch-Copy file:當文件存在的時候覆蓋

echo off

set src=\\dudu\new\IISStress.wsc

setdest=%SystemRoot%\System32\WebTest\Stress\IISStress.wsc

 

echo %dest%

 

:CHeck

IF EXIST %dest% (

echo%dest% is existed, start to copy....

GOTO:copy

) ELSE (

echo%dest% not existed, Looping....

call:sleep 2

GOTO:CHeck

)

 

:copy

copy/y %src% %dest%

echoFinished copy.

 

:sleep

:: sleep for xnumber of seconds

ping -n %1 127.0.0.1> NUL 2>&1

發佈了40 篇原創文章 · 獲贊 8 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章