a06lp Posted January 10, 2005 Share Posted January 10, 2005 Hi,I am trying to auto-associate mIRC with irc:// links. the only way to accomplish this seems to be to open mIRC, and then close it.can anyone make a AutoIt Script (exe) to open: "%systemdrive%\Program Files\sysreset\mirc.exe", and then close it once it loads? Link to comment Share on other sites More sharing options...
lilweirddude Posted January 10, 2005 Share Posted January 10, 2005 couldnt you just open it and taskkill it? or do you have to wait untill it fully loads Link to comment Share on other sites More sharing options...
aresgodofwar Posted January 10, 2005 Share Posted January 10, 2005 run("%systemdrive%\Program Files\sysreset\mirc.exe")sleep(5000)winclose("nameofwindowhere")try that. Link to comment Share on other sites More sharing options...
a06lp Posted January 10, 2005 Author Share Posted January 10, 2005 (edited) Run("%systemdrive%\Program Files\sysreset\mirc.exe")sleep(5000)winclose("mIRC")EXITI used this code, but it doesn't work...it says it cannot find the file.however, i checked a million times, that is the correct path.can autoit use %systemdrive%? or maybe the problem is the space between 'Program' and 'Files'??Here is a screenshot of the error, as well as the Program directory to show the file exists. Edited January 10, 2005 by a06lp Link to comment Share on other sites More sharing options...
p388l3s Posted January 10, 2005 Share Posted January 10, 2005 in AUTOIT you can't use the system variables like that it needs to process them differently, try :Run( @ProgramFilesDir & "\sysreset\mirc.exe")sleep(5000)winclose("mIRC")EXITThat should help the context for you Link to comment Share on other sites More sharing options...
a06lp Posted January 10, 2005 Author Share Posted January 10, 2005 works perfectly, thanks! Link to comment Share on other sites More sharing options...
p388l3s Posted January 10, 2005 Share Posted January 10, 2005 Welcome.I wonder though if you couldn't just run a Registry file to accomplish the same thing, find out which key is being hit to make the association, and just use that instead. Would do away with having to run the program once.Ahh well something to look into. Enjoy Link to comment Share on other sites More sharing options...
a06lp Posted January 18, 2005 Author Share Posted January 18, 2005 Run( @ProgramFilesDir & "\sysreset\mirc.exe")sleep(5000)winclose("mIRC")EXITok, slight problem with this method.works perfectly, in that it opens mIRC, and then closes it.however, when testing it on a clean install, i noticed that when mIRC opens, the "Windows Firewall" opens and asks what to do (unlock, etc.).Is there any way to add: "If windows firewall opens, then close it", so that IF the window opens, it is closed by this same autoit script? Link to comment Share on other sites More sharing options...
Nologic Posted January 18, 2005 Share Posted January 18, 2005 Run( @ProgramFilesDir & "\sysreset\mirc.exe" )WinWaitActive( "mIRC" )WinClose( "mIRC" )If WinExists( "Windows Firewall" ) Then WinClose( "Windows Firewall" )EXIT Link to comment Share on other sites More sharing options...
a06lp Posted January 18, 2005 Author Share Posted January 18, 2005 the above code has the right idea, but didn't work.here is the working modified code:Run( @ProgramFilesDir & "\sysreset\mirc.exe" )WinWaitActive( "mIRC" )WinClose( "mIRC" )If WinExists( "Windows Security Alert" ) Then WinClose( "Windows Security Alert" )EXIT Link to comment Share on other sites More sharing options...
prathapml Posted January 18, 2005 Share Posted January 18, 2005 Using a batch-file is far easier for future changes, ease-of-use, etc.start %ProgramFiles%\mIRC\mirc.exeREM to wait 10 secondssleep 10pskill mirc.exeget pskillget sleepThe best part is, you can put those additional EXEs in your System32 folder and use them later on for other purposes as well. Link to comment Share on other sites More sharing options...
Nologic Posted January 18, 2005 Share Posted January 18, 2005 a06lp -Well didn't know the window title. prathapml -Yes those are handy, but they don't close the window that he's needing closed...or at least not with the code shown...or the extent of my know how. Link to comment Share on other sites More sharing options...
prathapml Posted January 19, 2005 Share Posted January 19, 2005 They do actually. The commands will start mirc.exe and close it. If I'm not mistaken, that's what is needed? Link to comment Share on other sites More sharing options...
Nologic Posted January 19, 2005 Share Posted January 19, 2005 thats almost every thing...the other was the security alert. Link to comment Share on other sites More sharing options...
prathapml Posted January 19, 2005 Share Posted January 19, 2005 Security alert from SP2, right?Similarly, windows messenger, yahoo messenger, k-lite all these give the alert too. [HOWTO]: Pre-configure the windows firewall , blocking/allowing apps 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