DOS Batch processors move the specified number of files to a temporary folder, upload to a Linux server, and delete files under the Temp folder, uploading needs to rely on Pscp.exe.
The script is as follows:
@echo off&setlocal enabledelayedexpansion
#将400个xml文件从M: Move to the M:\scpepg\tmp\ directory under the \dockerepg\ directory
for/f "delims="%%i in (' dir/a-d/b/s "M:\dockerepg\*.xml" ') Do (set/a n+=1
If!n! Leq (move "%%i" "M:\scpepg\tmp\"))
#pscp with a password to upload files to the 172.28.8.81linux server/mnt/epg/directory
M:\SCPEPG\PSCP.EXE-PW ITVITV m:\scpepg\tmp\*.xml [email protected]:/mnt/epg/
#删除临时文件夹下的xml文件
Del m:\scpepg\tmp\*.xml/f/s/q/A
Pause
Move one folder file to another, specifying the number and suffix
1.
@echo off&setlocal enabledelayedexpansion
for/f " Delims= "%%i in (' dir/a-d/b/s" D:\a\*.rar "') does (set/a n+=1
If!n! leq (move"%%i "" D:\b\ ")) &nbs p;
pause
2.
@echo off&setlocal enabledelayedexpansion
FOR/R "D:\a"%%i in (*.rar) do (set/a n+=1
If!n! Leq (move "%%i" "D:\b\"))
Pause
DOS Batch processor Move the specified number of files to a temporary folder, upload to a Linux server, and delete files under the Temp folder