batch files

Started by Soap Mactavish, May 25, 2010, 06:25:29 PM

Previous topic - Next topic
is there a way to set a batch file to automatically open when you insert a flash drive into a computer? (the flash drive has the batch file on it)


"Were bigger than Jesus!"  -John Lennon

My best guess is you could try making an autorun.inf
In notepad type in:

[autorun]
open=haxxxx.bat

Then save it as autorun with the extention .inf. Stick it to the main directory of the flash drive (could be F:\, G:\, H:\, I:\,etc).

Plug in the flash drive again, double click it.

Report back if it works.

--AG


#TYBG

so, if i add the autorun, will it automatically run all bat files or can i specify which one? or where you referring to my specific file when you said haxxx?


"Were bigger than Jesus!"  -John Lennon

The specific file I just named haxxxx :P


#TYBG

also, forgot to add this in my initial question, can i also set it to automatically run my .exe file i asked u about a couple days ago?


"Were bigger than Jesus!"  -John Lennon

Yes.

[autorun]
open=lololololyourcomputerisdead.exe


#TYBG

so i can specify any file with this autorun command?....awesome


"Were bigger than Jesus!"  -John Lennon

Quote from: Soap Mactavish on May 25, 2010, 07:04:50 PM
so i can specify any file with this autorun command?....awesome

Yup, it's also how easy Worms (viruses) can spread via Flash Drive. It's also why I disabled Autorun on my computer.


#TYBG

May 25, 2010, 07:10:24 PM #8 Last Edit: May 26, 2010, 03:02:26 PM by Soap Mactavish
doesnt seem to be working on my Dell, but maybe it is because my batch file isnt "colorful enough" ill make a different one and get back to you.




The autorun didnt work so i asked my programming teacher and he said that i needed an autorun file. I asked him if .inf was the correct extension and he said he didnt think so, but he couldnt pull the one he thought was right off the top of his head either.


"Were bigger than Jesus!"  -John Lennon

.inf is right, Ag gave you good info, you must have made a typo.

ill try it again then. right now I am more focused on autoruning the exe file atm


"Were bigger than Jesus!"  -John Lennon