Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use batch processing to realize data backup of U disk

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "how to use batch processing to achieve U disk data backup", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use batch processing to achieve U disk data backup" this article.

Description:

1. Automatically detect all removable disks (if you want to apply to floppy disks, please add two drive letters An and B in the FOR statement)

2. All files in the default backup disk can be modified to back up files of a specified type according to the comments.

4. For more information, please see the notes in the code.

The batch code is as follows:

The code is as follows:

@ echo off

:: set the backup folder path

Set bakpth=D:\ UDISKBAK

:: if the variable type value is empty, all files in the USB drive are backed up by default, if only .RAR type files are backed up, then set type=.RAR, and so on

Set type=

: get the drive letter of the USB drive and perform the backup operation

For an in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (

)

Exit

: ucopy

:: copy USB disk files. Empty folders are not copied by default. If you need to copy empty folders, change the following command switch / s to / e

Xcopy / s/h/y% udisk%:\ *% type% "% bakpth%\% udisk%" > nul 2 > nul

Goto: eof

The above is all the contents of the article "how to use batch processing to achieve USB disk data backup". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report