shrum.net :: Code :: Autorun

|
Autorun
|
| A utility for portable media devices
that can be used to launch autorun.lnk or autoruin.bat files as part of
the autorun.inf. |
| |
[ If you are looking for the old Autorun that monitors for a file on newly
connected drives and runs them, that project was renamed to Launcher and can be
found here. CPUDOTBAT has been rewritten and
renamed to Autorun ]
Autorun.exe is a small utility that you place on MSC devices (flash drives,
external hard drives, etc) that can be
triggered via the autorun.inf. Since the auorun.inf cannot be used to run
a shortcut or batch file directly, you need to supply it a .EXE or .COM file.
Autorun.exe acts as the middleman.
autorun.inf -> autorun.exe -> autorun.lnk or autorun.bat
It's Windows-based, open source (GNU),
and solely written, maintained, hosted, and supported by me, Sean Shrum. Source code is written with
AutoIT (.au3) and the
most recent version can be found via the source link in the navbar above. If you're just looking for the latest binary build, it can be downloaded from
the binary link in the navbar above.
I created this utility when I needed to set up an external backup/sync drive
between my laptop and workstation. As I have both of these systems set up
with similar files in different folders, I wanted to create processes for the
two systems that I could easily customize to the system that the drive was
plugged into. The best way to do that was to create a utility that would
launch a batch file that had the computer name as part of the file name.
Place the autorun.exe file on the root of your MSC device (flash drive,
external drive, etc) and create / set up the autorun.inf like this:
[autorun]
run=autorun.exe
You can then create a autorun.lnk and/or a autorun.bat. Why a .lnk
file? Because you can use a .lnk file to tailor how the file it's linking
to is run (like a PIF file). You can set up a autorun.lnk to launch the
autorun.bat (or any file for that matter) in minimized mode if you like. You can
then create customized batch file to do system-specific processes using the
%computername% token or even do user-specific batch calls with %username% in
your batch file. Here are a few more command line tokens:
- %computername%
- %username%
- %userprofile%
- %systemdrive%
- %systemroot%
- %os%
- ...plus many others but that's for a command line tutorial.