Jump to content

Need some help with AutoIt?


a06lp

Recommended Posts

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


Run("%systemdrive%\Program Files\sysreset\mirc.exe")

sleep(5000)

winclose("mIRC")

EXIT

I 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.

_error.gif

Edited by a06lp
Link to comment
Share on other sites

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")

EXIT

That should help the context for you

Link to comment
Share on other sites

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

  • 2 weeks later...

Run( @ProgramFilesDir & "\sysreset\mirc.exe")
sleep(5000)
winclose("mIRC")
EXIT

ok, 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...