tonysathre Posted January 24, 2008 Share Posted January 24, 2008 I have a batch script that I put in my SendTo folder so I can mount disc images by right-clicking them, and selecting the SendTo item, using Daemon Tools. This works fine, but it opens up a console window for a couple seconds while it mounts. I wanted to replace it with an AutoIT script so that window won't pop up. I am using the Opt() ExpandEnvStrings. The Run() function doesn't seem to expand %1 to the patch of the image file. Run("%programfiles%\Daemon Tools\daemon.exe -mount 0,%1") When I point an image file to this script, I get a dialog box from Daemon Tools that says that it could not find the image file. Any help is appreciated. Thanks, Tony Link to comment Share on other sites More sharing options...
weaponx Posted January 24, 2008 Share Posted January 24, 2008 Run(@ProgramFilesDir & "\Daemon Tools\daemon.exe -mount 0," & $CmdLine[1]) Link to comment Share on other sites More sharing options...
tonysathre Posted January 24, 2008 Author Share Posted January 24, 2008 I tried this: Run("%programfiles%\Daemon Tools\daemon.exe -mount 0," $CmdLine[1]) I didn't know I needed the &. Thanks Link to comment Share on other sites More sharing options...
tonysathre Posted January 24, 2008 Author Share Posted January 24, 2008 I tried what you suggested and it didn't work. I got the same error message stating that; "Unable to mount image file. Unable to access image file." Opt("ExpandEnvStrings" , 1) Run(@ProgramFilesDir & "\Daemon Tools Lite\daemon.exe -mount 0," & $CmdLine[1]) Any other ideas? Thanks, Tony Link to comment Share on other sites More sharing options...
weaponx Posted January 24, 2008 Share Posted January 24, 2008 Run(@ProgramFilesDir & "\Daemon Tools Lite\daemon.exe -mount 0," & $CmdLine[1], @ProgramFilesDir & "\Daemon Tools Lite") Link to comment Share on other sites More sharing options...
tonysathre Posted January 24, 2008 Author Share Posted January 24, 2008 That didn't work either. I did however get it to work with this: Opt("ExpandEnvStrings" , 1) $Var1 = $cmdline[1] run('"c:\program files\Daemon Tools Lite\daemon.exe" -mount 0,"' & $var1 &'"') I found this by searching the forum, which I should have done in the first place. Thanks for your help. Tony Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now