Wednesday, Feb 4th  2026 @ 17:18:40  
 
 
  
www . shrum.net /sean/code/autorun
All scripting, coding, html, layout, design, .... basically everything here done by yours truly. - S

  

  
 
 
x86 news
 
filter
 clear search
 
 
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.
 

Introduction

[ 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.


Background

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.


Usage

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.
 
 
top

Page generation time = 0.0014/s
Page size (minus graphic elements) = 28kb

bookmark

feedback print

back

Since 1992 - shrum.net

Copyright 2026 Sean Shrum

 
 
CATS.PHP [C]ontent [A]cquisition and [T]emplating [S]cript v.4.14 [ 2025.12.14 ] by Sean Shrum