Jump to content

Recommended Posts

Posted

Firstly, I aplogize - this is my first script I've created with AutoIt and I wanted to run it by you.

Please let me now if this script is acceptable.

I'm trying to kill Communicator and Outlook then run a command in Start>Run.

Firstly, the error I see..is that I have to leave a space before Dos command is run because, it types so fast with the send command, that it skips the first letter..hence the space. (There has to be a better way)

Secondly, is there a better way to bring up the Start Menu>Run line. I am afraid some people may not have Left Windows button key for example.

Any ideas much appreciated.

Thank you,

Run("cmd.exe")
Send(" taskkill /f /im  communicator.exe")
Send("{ENTER}") 
Send(" taskkill /f /im  outlook.exe")
Send("{ENTER}")
Send(" exit")
Send("{ENTER}")
Send("{LWINDOWN}r{LWINUP}")
WinActivate("Run","")
Send("outlook.exe{SPACE}/cleanfreebusy{ENTER}")
MsgBox(0, "Script Completion!", "Outlook Troubleshooting Complete!")
Posted (edited)

Hi.

Welcome to the forum :mellow:

These functions should help you:

ProcessClose()

run()

runwait()

ShellExecute()

ShellExecuteWait()

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted

Forget the send commands. Use RunWait instead like that:

RunWait(@COMSPEC & " /c taskkill /f /im  communicator.exe")
Posted

Thank you so much for your help!! I have employed the use of ProcessClose which works great!

I wanted to ask if there is a better way than this:

Send("{LWINDOWN}r{LWINUP}")
WinActivate("Run","")
Send("outlook.exe{SPACE}/cleanfreebusy{ENTER}")

I want it to appear in the Run line from the Start Menu, as it won't execute in DOS.

Thank you again so much

Posted

Hi.

...

Send("{LWINDOWN}r{LWINUP}")
WinActivate("Run","")
Send("outlook.exe{SPACE}/cleanfreebusy{ENTER}")

I want it to appear in the Run line from the Start Menu, as it won't execute in DOS.

Did you try runwait() and shellexecutewait() in stead?

I can't see, why you should want to (ab)use start->run...

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

  • 2 weeks later...

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
×
×
  • Create New...