ShAddiX Posted July 23, 2007 Share Posted July 23, 2007 I want to write a script in AutoIt but I can't really figure out how to do this.It should do the following steps:- mount the cd image in daemon tools (without autoplay, no idea how to do this :/ )- then run the exe of the game/program- after exit, it should unmount the cd image and back to GameExI know it's quite easy, but especially the auoplay of games confuses me.Hope someone can help. Link to comment Share on other sites More sharing options...
Brian Hoffman Posted July 23, 2007 Share Posted July 23, 2007 I use batchfiles for this. Deamon Tools has the ability to mount via the commandline. You can diable all prompting and autorun via the program.Why would it need to ummount the image though? You could just end the program,Gameex will regain focus..Next game you select it will then mount that image. It is possable though.I use batchfiles to call my PSX isos I will post an example later this evening if you wish.@ECHO OFFc:CD "c:\program files\daemon tools\"daemon.exe -mount 0, "G:\Games\psx\CRONO2PSX.nrg"g:CD "G:\Console\psx\epsxe160"epsxe.exe -noguicd g:pskill epsxe.exe Link to comment Share on other sites More sharing options...
Nologic Posted July 24, 2007 Share Posted July 24, 2007 Well you'll need to disable the Auto Start for Daemon Tools, then you'll need to grab a copy of TweakUI and disable the Windows Auto Start...so basically you have two layers of Auto Start that must be disabled first off.Now are you looking to write a script per disc or are you looking at doing something different? Link to comment Share on other sites More sharing options...
ShAddiX Posted July 24, 2007 Author Share Posted July 24, 2007 Okay, I see.I want to use it per disc. One script for one game. (because not every game needs to mount an image). Link to comment Share on other sites More sharing options...
Nologic Posted July 24, 2007 Share Posted July 24, 2007 You'll need to edit the User Vars as needed....the rest of the script shouldn't require any changes.Per Disc Script; User Vars$image = "D:\Games\This_Is_My_Disc_Image.nrg"; Disc Image To Load$execute = "E:\Run_This_Executable.exe" ; Disc Executable To Run; Mount CD\DVD ImageRunWait ( 'C:\Program Files\Daemon Tools\daemon.exe -mount 0, "' & $image & '"' ); Launch Executable$PID = Run ( $execute ); Launch Child TerminationRun ( @ScriptDir & '\Kill_Child.exe "' & @AutoItPID & '" "' & $PID & '"' ); Wait for Emu to ExitProcessWaitClose ( $PID ); Close LoaderExit; EOFKill_ChildOpt ( 'TrayIconHide' , 1 ); Wait on Parent to ExitProcessWaitClose( $CmdLine[1] ); Kill Child ProcessProcessClose ( $CmdLine[2] )RunWait ( 'C:\Program Files\DAEMON Tools\daemon.exe -unmount 0' ); Close LoaderExit; EOF*Updated*Forgot to unmount CD\DVD image in Kill_Child Link to comment Share on other sites More sharing options...
ShAddiX Posted July 24, 2007 Author Share Posted July 24, 2007 Works great! Everything works like it should.Thank you VERY much!! Link to comment Share on other sites More sharing options...
Nologic Posted July 24, 2007 Share Posted July 24, 2007 Your welcome. Link to comment Share on other sites More sharing options...
Recommended Posts