Page 1 of 1

Creating Autorun Files

#1 polymath  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Posted 15 May 2008 - 01:39 PM

I wasn't sure where to put this, but autorun is mainly considered durring the development phase, and has to do with the overall structure of the application you're programming and distributing.

The autorun discussed here is for CD distribution of applications, such as computer games and install discs.

Whenever you put a game disc into a cd drive, a window will pop up prompting you to install it (in most cases). Well, how can you get this functionality in you own programs? Simple. It takes less than five minutes in most cases for a simple application.

Well, why make autorun files? The answer is obvious. Some users aren't as well learned in computers, and wouldn't know what files to execute. If a window automatically popped up it would make these peoples lives much easier. Also, I personally think it looks much more professional than having someone search their disc for a readme file, opening that, and then manually opening the files they need to.

The thing that makes autorun possible is the Autorun.inf file. These can be created in any simple text editor, like notepad. Simply open up that text editor and save it to your intermediary location with exactly that name: "Autorun.inf". Now, what you will need to put in there is relatively straightforward. First, you will need to start it off with: [autorun] . Next, the most important aspect of all. We need to create the code to open the file that we want when autorun is executed, so we need to add open=YourFileHere.exe. Also, although it is optional, its always good to have an icon for your window, so go ahead and add icon=YourIconHere.ico if you have an icon (note: I found a plugin for photoshop to edit ico files. You can find it here and download it for free). Finally, another optional command, though very useful, is labeling the drive. You can do that by adding label=YourLabelTextHere . So, the rudiments of an Autorun.inf file are:

You can add (in addition to the above) [autorun.platform] where platform is mips, alpha, ppc, among others. Then you can change the open values to platform-specific programs. You can also change the open line to shellexecute=YourFileHere.randomextension if your file is not a .exe file. Finally, you can insert UseAutoPlay=1 , but this command will be ignored prior to Windows XP, so the normal autorun will still execute. For more information, go to the Microsoft Autorun.inf Entries Page.

Microsoft has a long way of changing the Registry to test autorun, but if you only want to do a quick test, you can type in the following code to a command prompt, where YourPathHere is the directory Autorun.inf is in (assuming you aren't using T: as a drive):
SUBST T: "C:\YourPathHere"

This will trick the system into thinking that the autorun file is in the root directory of the new drive, T:, and run the autorun. Now, you should delete the drive so you can use that drive letter to test again, as this method only allows you to test once with a drive. This is done by typing this code into a command prompt:

Now, type SUBST without any paramaters. It should display a blank line, indicating you have no virtual drives (unless you have one other than T:, the one we used to test).


Is This A Good Question/Topic? 1
  • +

Replies To: Creating Autorun Files

#2 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Posted 13 October 2009 - 04:18 AM

for other comands, see here
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1