timjohnson Posted March 7, 2006 Share Posted March 7, 2006 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. Link to comment Share on other sites More sharing options...
Gigglestick Posted March 7, 2006 Share Posted March 7, 2006 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 Link to comment Share on other sites More sharing options...
timjohnson Posted March 8, 2006 Author Share Posted March 8, 2006 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 Link to comment Share on other sites More sharing options...
flyingboz Posted March 8, 2006 Share Posted March 8, 2006 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. 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