xeshan Posted June 8, 2010 Share Posted June 8, 2010 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!") Link to comment Share on other sites More sharing options...
rudi Posted June 8, 2010 Share Posted June 8, 2010 (edited) Hi. Welcome to the forum These functions should help you: ProcessClose() run() runwait() ShellExecute() ShellExecuteWait() Regards, Rudi. Edited June 8, 2010 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Juvigy Posted June 8, 2010 Share Posted June 8, 2010 Forget the send commands. Use RunWait instead like that: RunWait(@COMSPEC & " /c taskkill /f /im communicator.exe") Link to comment Share on other sites More sharing options...
xeshan Posted June 8, 2010 Author Share Posted June 8, 2010 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 Link to comment Share on other sites More sharing options...
rudi Posted June 8, 2010 Share Posted June 8, 2010 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! Link to comment Share on other sites More sharing options...
Juvigy Posted June 8, 2010 Share Posted June 8, 2010 RunWait(@COMSPEC & " /c start outlook.exe /cleanfreebusy") Link to comment Share on other sites More sharing options...
xeshan Posted June 17, 2010 Author Share Posted June 17, 2010 Thank you so much! I used: RunWait(@COMSPEC & " /c start outlook.exe /cleanfreebusy") 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