a06lp Posted January 10, 2005 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?
lilweirddude Posted January 10, 2005 Posted January 10, 2005 couldnt you just open it and taskkill it? or do you have to wait untill it fully loads
aresgodofwar Posted January 10, 2005 Posted January 10, 2005 run("%systemdrive%\Program Files\sysreset\mirc.exe")sleep(5000)winclose("nameofwindowhere")try that.
a06lp Posted January 10, 2005 Author 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
p388l3s Posted January 10, 2005 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
p388l3s Posted January 10, 2005 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
a06lp Posted January 18, 2005 Author 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?
Nologic Posted January 18, 2005 Posted January 18, 2005 Run( @ProgramFilesDir & "\sysreset\mirc.exe" )WinWaitActive( "mIRC" )WinClose( "mIRC" )If WinExists( "Windows Firewall" ) Then WinClose( "Windows Firewall" )EXIT
a06lp Posted January 18, 2005 Author 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
prathapml Posted January 18, 2005 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.
Nologic Posted January 18, 2005 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.
prathapml Posted January 19, 2005 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?
Nologic Posted January 19, 2005 Posted January 19, 2005 thats almost every thing...the other was the security alert.
prathapml Posted January 19, 2005 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
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