Windows Batch 复制日志在 Windows 7 中有效,但在 Windows 10 中无效

Windows Batch 复制日志在 Windows 7 中有效,但在 Windows 10 中无效
@ECHO OFF
::Destination folder, where log files compressed in zip will be copied
SET DestinationDir=c:\temp\ZodiacLogs

SET DATE="%date:~7,2%-%date:~4,2%-%date:~10,4%"
set /p DATE_FROM="Pls Enter From DATE (MM/DD/yyyy):- "
set /p DATE_TO="Pls Enter To Date(MM/DD/yyyy) :- "
set fdate=%date_from:~0,2%%date_from:~3,2%%date_from:~6,4%-%date_to:~0,2%%date_to:~3,2%%date_to:~6,4%
set time=%time::=%

ECHO Starting to copy the log files ......

PUSHD \\NGTSVR14\work

:: Advice Log
ECHO Copying Advice logs ... 
> nul forfiles /P \Advice\LogFile /s /D +%DATE_FROM% /C "cmd /C if @isdir==FALSE 2> nul forfiles /M  @file /D -%DATE_TO% && > con (cmd /c xcopy /S /Y /F @path %DestinationDir%\ops_logs_%fdate%\%computername%\Advice\)"

:: Crane Schedule server logs
ECHO Copying Workflow server logs ...
> nul forfiles /P \CraneScheduleServer\LogFile /D +%DATE_FROM% /C "cmd /C if @isdir==FALSE 2> nul forfiles /M  @file /D -%DATE_TO% && > con (cmd /c xcopy /S /Y @path %DestinationDir%\ops_logs_%fdate%\%computername%\CraneScheduleServer\)"


POPD

:: Below commands will Zip the folder

ECHO Zipping...

c:
cd C:\temp\ZodiacLogs

for /d %%X in (*ops*) do "c:\Program Files\7-Zip\7z.exe" a "ops_logs_%fdate%_%time%.zip" "%%X\"
for /d %%X in (*ops*) do RMDIR "%%X" /S /Q

pause

我使用上面的批处理将日志从服务器复制到 Windows 10 客户端,但它没有复制任何文件。从 Windows 7 客户端运行正常。请帮助解决

相关内容