gpt4 book ai didi

windows - Robocopy 参数选项

转载 作者:可可西里 更新时间:2023-11-01 10:38:55 27 4
gpt4 key购买 nike

我想用 robocopy 复制一个目录及其子文件夹。

我不想排除一些子文件夹和根目录中的所有文件。

现在我在不同的工作中复制目录,但我不想只有一个工作

$roboOptions = @("/e", "/xo", "/r:2", "/w:2", "/log+:$logFile")

#* Copy to Share2

# &robocopy $buildDrop $copyTargetMaster $roboOptions


#* Copy Share1

&robocopy $buildDrop"\Client" $copyTarget"\Client" $roboOptions
&robocopy $buildDrop"\Database" $copyTarget"\Database" $roboOptions
&robocopy $buildDrop"\dbscripts" $copyTarget"\dbscripts" $roboOptions
&robocopy $buildDrop"\EA" $copyTarget"\EA" $roboOptions
&robocopy $buildDrop"\Jobs" $copyTarget"\Jobs" $roboOptions
&robocopy $buildDrop"\replication" $copyTarget"\replication" $roboOptions
&robocopy $buildDrop"\server" $copyTarget"\server" $roboOptions

我该怎么做?

最佳答案

这是我的做法:

@ECHO off
>nul 2>nul robocopy
if errorlevel 9009 (
ECHO ROBOCOPY is not installed.
) else (
ECHO Starting 1-way backup of MEDIA(M:) to BACKUP(G:)...
robocopy.exe M:\ G:\ *.* /E /PURGE /SEC /NP /NJH /NJS^
/XD "$RECYCLE.BIN" "System Volume Information" /TEE /R:5 /COPYALL^
/LOG:from_MEDIA_to_BACKUP.log
ECHO Finished with backup.
)
pause

关于windows - Robocopy 参数选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9870884/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com