Jump to content

Recommended Posts

Posted

Hi there,

I got a autoit script thats runs perfectly on 3 different local desktop, but when I run it on a windows server, it scripts doen't works anymore.

Here are the codes:

WinWaitActive("Print")

Sleep(1000)

$state = WinGetState("Print")

If BitAnd($state, 1) Then

;If WinExists("Print") Then

Send("{ENTER}")

Else

$file = FileOpen("C:\exit.txt", 1)

FileClose($file)

Exit

EndIf

Could soemone help me on this one? Anyway ideas would be MUCH appericated!

Thank you.

Posted

1. Try ControlSend instead of checking for an active window and sending.

2. Why are you opening and immediately closing a file?! If you simply want the file to exist, use this...

FileWrite("C:\exit.txt", @CRLF)

My UDFs: ExitCodes

Posted

Thank you c0deWorm!

That works perfectly! What does the WinWaitActive code won't work on a window server? Because I got the same code on my desktop (Windows XP), which works perfectly as well, but when it run on windows server 2000, it stops working...

I really appericated your help. Thanks again.

Tim

Posted

What does the WinWaitActive code won't work on a window server? Because I got the same code on my desktop (Windows XP), which works perfectly as well, but when it run on windows server 2000, it stops working...

Have you looked at the windows info tool? What option modes do you have set? Examine these closely, and the solution will likely leap out at you.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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