Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

CD autorun script


  • Please log in to reply
3 replies to this topic
Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
I have never been able to get this pc to autorun CD's since I've had it but I've just made this script to detect every 10 seconds if a CD is inserted and then make it autorun depending on it's content. Took me a while to get right and it's not the most tidy script but it works.

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
}


:D

Beastmaster
  • Members
  • 191 posts
  • Last active: Apr 23 2007 02:58 PM
  • Joined: 15 Apr 2004
Nice work. But eh, based your OS there should be an option which allows to enable/disable the autorun for CDs and to select if this should be for valid for audio or data or both ... :wink:

Click this :arrow: How To Enable/Disable Autorun (Windows 95/98/Me/NT/W2K/XP/Other Removable Media)

Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
Thanks, I'll have a look at that later and try some of it.

I have tried quite alot already to get it to run and it seems to run in safe mode for some reason (although I only tested it with one CD). I downloaded a script from here http://www.mvps.org/sramesh2k/ to enable cd autorun and got "Access denied" when trying to open CD's. It seems to be some strange security setting or something.

Anyway, thanks for the link, I'll go through it later

Thanks, Jon :D

Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
Hi, I just went through that web site and a few other I found and unfortunately the CD's still won't autorun.

That script will do for now though until I have time to try and get it working properly.

Thanks for your help, Jon :)