SWBFGamers

Community Area => Tech Support => Topic started by: Soap Mactavish on May 25, 2010, 06:25:29 PM

Title: batch files
Post by: Soap Mactavish on May 25, 2010, 06:25:29 PM
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)
Title: Re: batch files
Post by: aeria. on May 25, 2010, 06:48:17 PM
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
Title: Re: batch files
Post by: Soap Mactavish on May 25, 2010, 06:53:36 PM
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?
Title: Re: batch files
Post by: aeria. on May 25, 2010, 06:54:26 PM
The specific file I just named haxxxx :P
Title: Re: batch files
Post by: Soap Mactavish on May 25, 2010, 06:57:21 PM
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?
Title: Re: batch files
Post by: aeria. on May 25, 2010, 06:58:07 PM
Yes.

[autorun]
open=lololololyourcomputerisdead.exe
Title: Re: batch files
Post by: Soap Mactavish on May 25, 2010, 07:04:50 PM
so i can specify any file with this autorun command?....awesome
Title: Re: batch files
Post by: aeria. on May 25, 2010, 07:05:43 PM
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.
Title: Re: batch files
Post by: Soap Mactavish on May 25, 2010, 07:10:24 PM
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.
Title: Re: batch files
Post by: vf501 on May 31, 2010, 01:54:38 AM
.inf is right, Ag gave you good info, you must have made a typo.
Title: Re: batch files
Post by: Soap Mactavish on May 31, 2010, 05:43:45 AM
ill try it again then. right now I am more focused on autoruning the exe file atm
EhPortal 1.34 © 2024, WebDev