If you have created a program and want to let it autorun when someone inserts a USB/DVD/CD in their PC, then all you need to do is burn a small file with that program. In this post, we will explain how to create a simple and advanced Autorun file.
When do you need an Autorun File
Say you have a program “XYZ.EXE” and you want to run it automatically when you insert your USB/DVD/CD. Typically Windows looks for an information file called Autorun.inf. Its a simple text file that contains information on which program Windows should automatically launch when the storage device is inserted. In other words, autorun.inf tells Windows how to deal open the presentation and treat the contents of the CD.
Create an Autorun file for your USB/DVD/CD
To enable AutoRun, you need two essential files— An Autorun.inf file and a Startup application or executable.
Follow the steps to create one for your application.
Open Notepad, and write the following line as it is:
[autorun]
OPEN=XYZ.EXE
Save it as “Autorun.inf”
Now burn your CD/DVD with the autorun .inf file included. In the case of a USB drive, you need to copy and paste the INF file in it.
How to further enhance the Autorun.inf File
Use this instead:
[autorun] OPEN=SETUP.EXE ICON=SETUP.EXE,0 shell\configure=&Configure... shell\configure\command=SETUP.EXE shell\install=&Install... shell\install\command=SETUP.EXE shell\admin\=&Launch the Office Customization Tool shell\admin\command=SETUP.EXE /admin shell\cmdline\=setup &Controller Command-Line Help shell\cmdline\command=SETUP.EXE /?
It will add a right-click context menu that can be tailored for your application. You can choose to target particular executables inside the storage device, add an icon, and so on.
Read: How to enable or disable AutoPlay in Windows.
Autorun.inf Generator
If you find it hard to use a notepad to generate an Autorun file, then you can use this simple program called Autorun.inf Generator which allows you to create it easily.
When you launch the program, you get options to add the following:
- Autorun Executable
- Autorun Icon
- Drive label
- Context menu ( Two)
- Autorun link
- Support Link.
That’s about it.
I hope the post helps you create the Autorun file for USB/DVD/CD media.
How to make a USB autorun a file?
To make a USB autorun a file, create an autorun.inf file with the command ‘open=filename.exe’ and place it in the USB’s root directory. For the autorun feature to work correctly, Ensure the USB is formatted in a compatible file system like FAT32 or NTFS.
How do I create an autorun folder?
To create an autorun folder, place an “autorun.inf” file in the root directory of the folder. Inside “autorun.inf,” use the “shellexecute” command followed by the file or application you want to run automatically. This setup will trigger the specified executable when the folder is accessed.
How do I make USB play automatically?
To make USB play automatically on Windows, go to Settings > Devices > AutoPlay. Enable AutoPlay and set the default action for your device under “Removable drive.” This will automatically allow your USB to open or play based on your preferences.