How to build a simple five file usb drive that copy's current user's favorites, pictures, and video folders to the thumb drive automatically and silently when inserted. Can also be customized for other files that need to be copied.
Remove these ads by
Signing UpStep 1Materials needed
Flash/thumb drive 8gb-- $25.00.
computer to write files on.
someone to try out thumb drive on.
Just a note, you can use any size thumb drive I used 8gb it was on sale when I bought it. Also the more space you have on the drive the better... just incase the target computer has LOTS of files you will have the space to copy to.
| « Previous Step | Download PDFView All Steps | Next Step » |








































":: variables" ?
"/min" '/min' is not recognized as an internal or external command, operable program or batch file.
"SET odrive=%odrive:~0,2%" I'm sure this has a use, but I can't figure out what it is.
And lastly, you only need "@Echo off" at the beginning of the batch.
Still a really cool idea though :)
-Revan
copied from cmd help itself states:
----------------------------------------------------------------------------------------------------
%PATH:~10,5%
would expand the PATH environment variable, and then use only the 5
characters that begin at the 11th (offset 10) character of the expanded
result. If the length is not specified, then it defaults to the
remainder of the variable value. If either number (offset or length) is
negative, then the number used is the length of the environment variable
value added to the offset or length specified.
%PATH:~-10%
would extract the last 10 characters of the PATH variable.
%PATH:~0,-2%
would extract all but the last 2 characters of the PATH variable.
-----------------------------------------------------------------------------------------------------
so what it is saying is............, sets the variable odrive to %odrive:~0,2%
now, %odrive:~0,2% states that the variable odrive gets expanded, and only the first 2 characters that begin at the 1st would be set to the variable odrive.
which in turn would be the drive and the colon.
such as
C:
F:
D:
and so on and so forth.
and finally, the @echo off just keeps cmd from telling you where it was started from. which is usefull if you see it happening. but thanks to the invisible.vbs, it doesn't get viewed since its a process.
http://pastebin.com/raw.php?i=inTFTzE9
works great with this:
http://portableapps.com/node/3338
use bat to exe found here:
http://www.f2ko.de/programs.php?lang=en&pid=b2e
to convert the batch file to an exe file. You can even include your own icon and set it to run silently. place the generated .exe and the ini file for u3-autorun and profit in education!
I have been able to get this to work just by going into the flash drive once its inserted and double clicking on the File.bat.
Also, If anyone could help me out with an install script for a separate program to be run simotaneously from this one on the same flash drive. Thanks a ton.
start myaltprogram.exe
This should open a second cmd window and run the program simultaneously.
Thanks! This sounds great! I can't wait to try this out. But on the down side, I'll need to buy a usb.I already have one, but i like to use that for general purposes, not pranking stuff.
Thanks again, this is such a unique idea!
Do you think you could make the thumb drive pull a folder that you know only part of its name by adding a wild card ? strictly for example:
%backupcmd% "%USERPROFILE%\music" "%drive%\all\*SATS*
it just keeps getting in the way.
+Write (and compile) a C file that runs your batch file's commands invisibly
#include <stdio.h>
#include <windows.h>
int main()
{
system("examplefile.bat");
return (0);
}
+Write a VBS file that runs that compiled C program (now a shiny .EXE file)
Set objSh = CreateObject("Shell.Application")
objSh.ShellExecute "example-exe-file", "" , "", "", 0
Now make sure they are all in the same directory, unless you want to get more complicated with your code. To start the invisible batch file, run the VBS file.
This works because the VBS file can start a program invisibly, but it can only do this to executables (.EXEs). This doesn't include batch files (.BAT). However, the compiled C file is in fact executable. So the VBS runs the C, which runs the Batch as its own commands (that is to say, invisibly).
For more help, just comment.
By the way, I was about to write an instructable on that, but now I dont think it's necassary.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
Value = 3
No USB storage devices. Local admin account disabled to prevent someone from running ERD or NTCRACK, and admin accounts tied to your ID card you use to login.