Solved

Autorun

Posted on 1998-09-21
5
674 Views
Last Modified: 2013-12-29
What is the syntax for the Autorun/Autoplay feature in Windows 95, 98 and NT?
0
Comment
Question by:kencurp
  • 2
  • 2
5 Comments
 

Author Comment

by:kencurp
ID: 1723531
Adjusted points to 200
0
 
LVL 5

Expert Comment

by:theh95
ID: 1723532
In various ways, titles and games that run off a CD-ROM feel different from other applications. First, starting CD-ROM programs differs from starting hard-disk–based applications. First, users have to open a drawer, extract the right disk, and place it in the CD-ROM drive before they can run the program like any other program—assuming, of course, that they can find the icon they created when they first installed the program. A second difference between CD-ROM programs and hard-disk–based applications is that CD-ROM products may be used irregularly.
While watching users run multimedia applications, Microsoft realized that the act of placing a disk in a CD-ROM drive is loaded with information. If the CD-ROM is a program that the user has never run before, the act of putting the CD-ROM in the drive means that the user intends to install the program. If the program has already been installed, the act of putting the CD-ROM in the drive means that the user intends to run the program.
In Windows 95, a feature called AutoPlay allows software developers to make their products easier for users to install and run. When the user puts a disk in a CD-ROM drive, Windows 95 automatically spins it and looks for a file called AUTORUN.INF. If this file exists, Windows 95 opens it and follows the instructions. This new feature makes the setup instructions for a Windows 95–based multimedia game or title almost absurdly easy, reducing them to something like the following:
 1.      To play this program, insert the disk in your CD-ROM drive.
 2.      Have a nice day!
 

 



PSS ID Number: Q126025
Article last modified on 06-23-1998
 
95 98
 
WINDOWS
 

======================================================================
---------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft Windows 95
 - Microsoft Windows 98
---------------------------------------------------------------------
 
SUMMARY
=======
 
Microsoft Windows can play an audio CD automatically when you insert it
into a CD-ROM drive. This article describes how to disable this feature.
 
MORE INFORMATION
================
 
To prevent Windows from playing an audio CD automatically, use either
of the following methods.
 
Method 1
--------
 
The following steps describe how to prevent Windows from playing all
audio CDs automatically:
 
1. Double-click My Computer.
 
2. On the View menu, click Options.
 
3. Click the File Types tab, then double-click AudioCD in the Registered
   File Types box.
 
4. Click the Set Default button (the word "Play" will no longer appear
   in bold in the Actions box) and then click the Close button.
 
5. Click the Close button.
 
To allow Windows to play audio CDs automatically, follow the above steps
again. The word "Play" should appear in bold in step 4. If audio CDs still
do not play automatically, follow these steps:
 
1. Click the Start button, point to Settings, and then click Control
   Panel.
 
2. Double-click the System icon.
 
3. Click the Device Manager tab, double-click CD-ROM, then double-
   click the installed CD-ROM device.
 
4. Click the Settings tab, then click the Auto Insert Notification
   check box so that the box is checked.
 
5. Click the Close button until you are prompted to restart your computer,
   then click the Yes button.
 
Method 2
--------
 
To prevent Windows from playing an audio CD automatically, press down
and hold the SHIFT key as you insert the audio CD in the CD-ROM drive.
 
NOTE: If you are playing an audio CD with Windows CD Player and insert
a second audio CD in another CD-ROM drive, the first CD will stop playing
and CD Player will restart using the new audio CD. This will occur only if
both CD-ROM drives are using a Windows protected-mode driver and you
have Auto Insert Notification enabled.
 
MORE INFORMATION
================
 
CD-ROMS containing an Autorun.inf file are played automatically when
inserted in the CD-ROM drive, and the instructions in the Autorun.inf file
are carried out. The Cdvsd.vxd driver polls repeatedly to detect CD-ROM
insertion. When a CD-ROM is detected, Windows is notified that a new
volume is available and the drive is checked for an Autorun.inf file. If
found, programs listed on the "open=" line in the [AUTORUN] section are
run.
 
If the volume is determined to be an audio CD-ROM, Windows performs the
default action, if any, associated with that file type. "Play" is normally
the default action for the AudioCD file type.
 
NOTE: Windows does not play CD-ROMs automatically if you are using
only real-mode CD-ROM drivers. Protected-mode drivers are required to play
CD-ROMs automatically upon insertion.
 
Additional query words: 95 98 autoplay
======================================================================
Keywords          : kbenv kbhw win98 win95
Version           : 95 98
Platform          : WINDOWS
Issue type        : kbhowto
=============================================================================
Copyright Microsoft Corporation 1998.


 

0
 
LVL 2

Expert Comment

by:bushhead
ID: 1723533
i think by syntax means that y ou wanted to know how to put commands in right?

------------

When preparing a CD for Win95, put a file called "autorun.inf" in the root directory, with entries that look like this:

     [autorun]
     open=filename.exe
     icon=someicon.ico

When the CD is placed into a drive with auto-insert notification enabled, it will be shown with the specified icon, and the program named will be launched. (If you
turned auto-insert notification off while burning the disc, you may need to reboot before the feature is re-enabled.)

Here's a more complicated example:

     [autorun]
     open = setup.exe /i
     icon = setup.exe, 1
     shell\configure = &Configure...
     shell\configure\command = setup.exe /c
     shell\install = &Install...
     shell\install\command = setup.exe /i
     shell\readme = &Read Me
     shell\readme\command = notepad help\readme.txt
     shell\help = &Help
     shell\help\command = winhlp32 help\helpfile.hlp

Taking it line by line, this says:

     The default AutoPlay command will be "setup /i"
     The icon for the CD will be icon #1 in setup.exe

     Four commands will be added to the right-click pop-up menu:

'Configure...',
     which will run "setup /c"
'Install...',
     which will run "setup /i" (same as auto-run in this case)
'Read Me',
     which launches notepad.exe to display "readme.txt"
'Help',
     which displays a helpfile with the Win95 help facility

For more information:

http://www.microsoft.com/win32dev/uiguide/uigui276.htm
     http://www.gui.com.au/avdf/oct95/samp_autoplay.html

A program that will allow you to test autoplay without burning a CD:

     http://www.connect.net/gstrope/autotest.htm

(Actually, if you SUBST a folder onto a drive letter, the autorun feature in Win95 will scan the new drive. For example, "SUBST J: \goodies\NewCD". This
technique is also useful for testing out a CD-ROM you're preparing.)

A simple, configurable autorun application called "AutoRun Action Menu" is available as shareware:

     http://www.powerup.com.au/~calypso/autorun.htm



                          Supporting AutoPlay

                          Windows supports the ability to automatically run a file when the user inserts removable media that support
                          insertion notification, such as CD-ROM, PCMCIA hard disks, or flash ROM cards. To support this feature, include a
                          file named Autorun.inf in the root directory of the removable media. In this file, include the filename of the file to
                          run, using the following syntax.

                          [autorun]
                          open = <e>filename
                          </e>

                          Unless you specify a path, the system looks for the file in the root of the inserted media. If you want to run a file
                          located in a subdirectory, include a path relative to the root; include that path with the file as in the following
                          example.

                          open = My Directory\My File.exe

                          Running the file from a subdirectory does not change the current directory setting. The command-line string you
                          supply can also include parameters or switches.

                          Because the autoplay feature is intended to provide automatic operation, design the file you specify in the
                          Autorun.inf file to provide visual feedback quickly to confirm the successful insertion of the media. Consider using a
                          startup up window with a graphic or animated sequence. If the process you are automating requires a long load
                          time or requires user input, offer the user the option to cancel the process.

                          Although you can use this feature to install an application, avoid writing files to the user's local disk without the
                          user's confirmation. Even when you get the user's confirmation, minimize the file storage requirements, particularly
                          for CD-ROM games or educational applications. Consuming a large amount of local file space defeats some of the
                          benefits of the turnkey operation that the autoplay feature provides. Also, because a network administrator or the
                          user can disable this feature, avoid depending on it for any required operations.

                          You can define the icon that the system displays for the media by including an entry in the Autorun.inf file that
                          includes the filename (and optionally the path) including the icon using the following form.

                          icon = <e>filename
                          </e>

                          The filename can specify an icon, a bitmap, an executable, or a dynamic-link library file. If the file contains more
                          than one icon resource, specify the resource with a number after the filename -- for example, My File.exe, 1. The
                          numbering follows the same conventions as the registry. The default path for the file will be relative to the
                          Autorun.inf file. If you want to specify an absolute path for an icon, use the following form.

                          defaulticon = <e>path
                          </e><idx id=10_RGSTR.DOC-1265>

                          The system automatically provides a pop-up menu for the icon and includes AutoPlay as the default command on
                          that menu, so that double-clicking the icon will run the Open = line. You can include additional commands on the
                          menu for the icon by adding entries for them in the Autorun.inf file, using the following form.

                          shell\verb\command = <e>filename</e>
                          shell\verb = <e>Menu Item Name
                          </e><idx id=10_RGSTR.DOC-1268>

                          To define an access key assignment for the command, precede the character with an ampersand (&). For example,
                          to add the command Read Me First to the menu of the icon, include the following in the Autorun.inf file.

                          shell\readme\command = Notepad.exe My Directory\Readme.txt
                          shell\readme = Read &Me First

                          Although AutoPlay is typically the default menu item, you can define a different command to be the default by
                          including the following line.

                          shell = verb
                          <idx id=10_RGSTR.DOC-1273>

                          When the user double-clicks on the icon, the command associated with this entry will be carried out


~is that it is totally non-intrusive. It relies only on a simple ASCII file (AUTORUN.INF) being in the root directory of the CD, and the fact that Win95s 32-bit CD
drivers automatically detect CD insertion and search for that particular file.

Another thing to like is the absolute simplicity of the AutoPlay syntax - a grand total of five possible commands.

The smallest autorun.inf file contains two lines of text and simply identifies the startup application:

[autorun]

open=filename.exe

So, in most cases, the OPEN= is going to be the name of your setup application, and after that you can do as you please. Now thats simple! You can specify an
absolute CD path as well, but otherwise AutoPlay assumes the root directory of the CD. If the file you specify is a registered document, Win95 starts the application
associated with the specified document. Im not sure Id use this option, as it makes some assumptions that Im not too happy about, but in the corporate
environment, it may well come in handy. You can also include command-line parameters as required.

Another cool feature is the default icon argument. This is what Windows 95 uses to set the icon for the CD in Explorer (and even My Computer, if you can stand
using it). The syntax is :

defaulticon=path\iconname.ico

which provides an absolute CD path (sans drive letter, of course) to locate the icon that represents the CD. You can also specify an .exe, .bmp or .dll file. If you
have more than one icon in the file, youll need to add a zero-based offset argument. To whit :

defaulticon=myfile.exe 1

One option Id like everyone to keep away from is the shell=verb command. This changes the default entry of the shortcut menu to the specified custom command.
This sounds great on paper - what could be handier than setting a convenient default for users from Explorer (or that other My Computer thingy)? Now
double-click on a CD that uses this feature. What you get is, not what you expect - a directory listing. Which runs absolutely counter to the whole notion of a
consistent interface. I guess it might be handy for applications which run exclusively from the CD, but it is certainly confusing. Even worse is the fact that,
unavoidably, AutoPlay-enabled CDs set the default to Autoplay.

A verb is the abbreviated version of a custom command you also specify using the shell\verb\command and shell\verb commands. shell\verb provides the menu item
name on the shortcut menu, while shell\verb\command provides the actual command syntax.

---

i thikn that should cover it all

bush
0
 

Author Comment

by:kencurp
ID: 1723534
bushhead answered my question very well.  how do I give bushhead the points?
0
 
LVL 2

Accepted Solution

by:
bushhead earned 200 total points
ID: 1723535
i just post this as an answer, then you can award me the points :)

thanks kencurp

bush
0

Featured Post

Wish Marketing would stop bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now