Jump to content
Sign in to follow this  
Balaji4u

Script crashes windows

Recommended Posts

Balaji4u

Hi ,

I am new to autoit and started off with some examples . I wrote a script to open a word pad and write some text and close it .

My script looks like this.

Run ("wordpad.exe")

WinWaitActive("Document - WordPad")

Send("Hello.")

WinClose("Document - WordPad")

WinWaitActive("Wordpad", "Do you want to save")

Send("!n")

Now this looks fine to me , but not to windows. It literally crashes the task Bar nothing functions .

Any idea whats wrong ?. Even just using "Run" command to open a notepad or a word pad doesnt work .

R

B

Share this post


Link to post
Share on other sites
veronesi

Hi,

try this code:

ShellExecute("wordpad.exe")
WinWaitActive("Document - WordPad")
Send("Hello.")
WinClose("Document - WordPad")
WinWaitActive("WordPad")
Send("!n")

Best Regards

Veronesi

Share this post


Link to post
Share on other sites
Balaji4u

Hi,

Thanks for the reply , this code works fine.

Regards,

Balaji

try this code:

ShellExecute("wordpad.exe")
WinWaitActive("Document - WordPad")
Send("Hello.")
WinClose("Document - WordPad")
WinWaitActive("WordPad")
Send("!n")

Best Regards

Veronesi

Share this post


Link to post
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
Sign in to follow this  

×