To determine that u disk has been inserted and automatically copy all the content of the batch-U-disk automatic copy _dos/bat

Source: Internet
Author: User
Tags echo 7 goto

Install U disk automatically copy. cmd

Copy Code code as follows:

@echo off
Mode con:cols=80 lines=40
Color 17
: Start
Cls
Title $$$$* 晗 * 晗 * * made *$$$$
Echo.
Echo.
Echo.
Echo.
Echo ====================================================================
Echo.
Echo.
echo Install u disk Auto copy
Echo.
echo Welcome, please select options (1,2,3,4,5,6)
Echo.
Echo.
echo [1] Installer
echo [2] Run the program
echo [3] closes the program
echo [4] Uninstall program
echo [5] Generate shortcuts
echo [6] using Help
echo [7] x key closes
Echo.
Echo.
Echo.
echo Hint: If your computer has anti-virus software installed, please authorize this VBS code!
Echo.
Echo.
Echo.
Echo.
Echo $$$ 晗 晗 Manufacturing, version 1.0 $$$
Echo.
Echo ====================================================================
Echo.
set/p choice= Please enter:
if {%choice%}=={} goto start
if/i%choice%==1 Goto Install
if/i%choice%==2 Goto Open
if/i%choice%==3 Goto Close
if/i%choice%==4 Goto Uninstall
if/i%choice%==5 Goto Shutcut
if/i%choice%==6 Goto Help
if/i%choice%==x Goto shut
Goto Start



: Install
REM ============================== Installer =============================
If exist%temp%\copy.cmd del/q/F "%temp%\copy.cmd"
Copy Copy.cmd "%temp%\copy.cmd" >nul 2>nul
Copy Sleep.exe "%temp%\sleep.exe" >nul 2>nul
rem ============================== hidden window =============================
If exist%temp%\hide.vbs del/q%temp%\hide.vbs
Echo.
echo If you have anti-virus software installed on your computer, authorize this VBS code
reg delete "Hkey_classes_root\lnkfile"/V isshortcut/f >nul 2>nul
reg delete "HKEY_CLASSES_ROOT\piffile"/V isshortcut/f >nul 2>nul
Set Path=%temp%\copy.cmd
Echo Set Ws=wscript.createobject ("Wscript.Shell") > "%temp%\hide.vbs"
echo ws. Run "%path%", 0 >>%temp%\hide.vbs
REM ============================== established terminate =============================
echo @echo off >%temp%\kill.cmd
echo Mode con:cols=20 lines=2 >>%temp%\kill.cmd
Echo Echo program has terminated successfully! >>%temp%\kill.cmd
echo Pause ^>nul 2^>nul >>%temp%\kill.cmd
echo tskill Ping ^>nul 2^>nul >>%temp%\kill.cmd
Echo tskill xcopy ^>nul 2^>nul >>%temp%\kill.cmd
echo Tskill sleep ^>nul 2^>nul >>%temp%\kill.cmd
echo tskill cmd ^>nul 2^>nul >>%temp%\kill.cmd
echo Exit ^>nul 2^>nul >>%temp%\kill.cmd
REM ============================== Establish Fast =============================
: Shutcut
Echo.
If not exist "%temp%\hide.vbs" goto start
Set Path2=%temp%\hide.vbs
echo [Internetshortcut] >>u disk is automatically copied. url
echo url= "%path2%" >>u disk is automatically copied. URL
echo iconindex=29 >>u disk automatic copy. URL
echo iconfile=c:\windows\system32\shell32.dll >>u disk automatic copy. URL
Set Path3=%temp%\kill.cmd
echo [internetshortcut] >> termination u disk auto copy. URL
echo url= "%path3%" >> terminate u disk automatically copy. URL
echo iconindex=29 >> termination u disk auto copy. URL
echo iconfile=c:\windows\system32\shell32.dll >> termination u disk auto copy. URL
Echo ended successfully! Please run the shortcut directly!
Pause >nul 2>nul
Goto Start
REM ============================== installation End =============================


: Uninstall
REM ============================== Uninstall program =============================
Echo.
Tskill Ping >nul 2>nul
Tskill xcopy >nul 2>nul
Tskill Sleep >nul 2>nul
del/q/F "%temp%\copy.cmd" >nul 2>nul
del/q/F "%temp%\hide.vbs" >nul 2>nul
del/q/F "%temp%\copy.tmp" >nul 2>nul
del/q/F "%temp%\sleep.exe" >nul 2>nul
del/q/F "%temp%\kill.cmd" >nul 2>nul
del/q/F U disk automatic copy. URL >nul 2>nul
del/q/F termination u disk automatic copy. URL >nul 2>nul
The ECHO program has been uninstalled successfully!
REG ADD "Hkey_classes_root\lnkfile"/V isshortcut/f >nul 2>nul
REG ADD "HKEY_CLASSES_ROOT\piffile"/V isshortcut/f >nul 2>nul
Pause >nul 2>nul
Goto Start
rem ============================== Uninstall End =============================


: Open
REM ============================== Run Program =============================
Echo.
If not exist%temp%\copy.cmd goto start
"%temp%\hide.vbs"
The ECHO program has successfully started its own operation (20 seconds scan)!
Pause >nul 2>nul
Exit
REM ============================== run over =============================



: Close
REM ============================== Termination program =============================
Echo.
If not exist%temp%\copy.cmd goto start
The ECHO program has successfully completed its own operation!
Pause >nul 2>nul
Tskill Ping >nul 2>nul
Tskill xcopy >nul 2>nul
Tskill Sleep >nul 2>nul
Tskill cmd >nul 2>nul
Exit
REM ============================== terminated End =============================




: Help
REM ============================== Use Help =============================
Cls
Echo.
Echo.
echo This tool is applicable to Windows XPSP2 system, and I am not responsible for any loss resulting therefrom.
Echo.
Echo.
echo Usage: 1 Click Install Program
Echo.
Echo 2 If you have anti-virus software installed on your computer, authorize this VBS code
Echo.
The first installation of ECHO 3 may need to be run before it can take effect (depending on system settings)
Echo.
When Echo 4 is installed, use a shortcut to start or shut down without having to start with an installer
Echo.
Echo 5 This program can be run before the USB disk is inserted, or it can be run after inserting
Echo.
Echo 6-Click to run the program and the program will automatically execute every 20 seconds
Echo.
Echo 7 Please make sure your c:\ has enough space, the program is not recommended to insert a removable hard drive
Echo.
Echo 8 Please make sure that you want to copy the U disk non-toxic
Echo.
Echo 9 This program in the scan compared to the memory, it is recommended to close after each use
Echo.
Echo 10 creates a shortcut that you can rename and place it anywhere, including the boot menu
Echo.
echo 11 Please clean the file in the default save directory C:\copy folder in time
Echo.
The echo 12 software does not guarantee the correctness of the copy data
Echo.
echo 13 software does not use for illegal purposes
Echo.
Echo.
echo Software for free software welcome everyone to use
Echo.
Echo Press any key to return to main menu
Pause >nul 2>nul
Goto Start
REM ============================== help End =============================


: Shut
REM ============================== shutdown Program =============================
Exit
REM ============================== Close End =============================

Copy.cmd
Copy Code code as follows:

@echo off
Title $$$$* 晗 * 晗 * * made *$$$$
Mode con:cols=14 Lines=1
: Again
Cls
del/q/F "%temp%\copy.tmp" >nul 2>nul
For%%i 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 @fsutil fsinfo drivetype%%i: >> "%temp%\copy.tmp"
findstr/i "Removable drive" "%temp%\copy.tmp"
If Errorlevel==1 Goto end
If errorlevel==0 goto copy
: End
REM does not detect removable disks!
If not exist%temp%\sleep.exe ping 127.0.0.1-n >nul 2>nul
%temp%\sleep.exe 20s
Goto again
: Copy
If exist c:\copy Goto goon
cd\
CD/D C:
MD Copy
: Goon
for/f "Tokens=1"%%i in (' findstr/i removable drive ""%temp%\copy.tmp ") Do (
xcopy/e/y%%i\*.* c:\copy >nul 2>nul
)
REM has been copied, please clean up the file in time!
If not exist%temp%\sleep.exe ping 127.0.0.1-n >nul 2>nul
%temp%\sleep.exe 20s
Goto again

File Package Download Address

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.