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

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.