Might also be useful if you want to make the autorun of CD's more customisable.
detect: IfExist, D:\autorun.inf { IniRead, OutputVar, D:\autorun.inf, autorun, open run, D:\%OutputVar% } IfExist, D:\*.cda { run, wmplayer winwait, ahk_class WMPlayerApp,, 10 PostMessage, 0x111, 19682, 0, , ahk_class WMPlayerApp } loop { IfExist, D:\*.* { sleep, 10000 } else { sleep, 10000 goto, detect } sleep, 10000 }