RogerRabbitsClone Posted January 16, 2012 Posted January 16, 2012 ok so heres my situation:our company needs to have a filemaker pro 11 file open and accessible to multiple users on our windows home server. but i was getting an error (file conflicts etc etc) because the file was open for more then 24 hours. so, i wrote and compiled a script that runs as a scheduled task, to close the program, then reopen it 5 hours later in the wee hours of the morning.my script works fine when i am remotely logged in, however, will not run when i am not. i tracked down the problem to this: autoit simulates keystrokes. and when it opens the file, it sends each keystroke for the password, then sends "enter" etc etc. but when no one is logged in remotely, i believe WHS blocks any input. i have tested this by logging in, starting the script, immediately closing the remote session, then logging back in a few minutes later. the script was paused on a "winwaitactive"i am at a loss. i also have a post on wegotserved.com (link to my post). there, im asking if theres a way to trick the server into thinking there is an active remote session, but i wanted to ask here as well.does anyone have any experience in scripting with WHS? links, insight, better method ?thank you autoitershere is my code.;open the list ShellExecute ("\\server\LISTS (DO NOT TOUCH)\2012 - Win_Spr.fp7") sleep (1000) while 0 ;double check its open and loop this because sometimes it doesnt open. i dont know why. if not ProcessExists ("FileMaker Pro.exe") Then ShellExecute ("\\server\LISTS (DO NOT TOUCH)\2012 - Win_Spr.fp7") sleep (1000) else ProcessExists ("FileMaker Pro.exe") Then ExitLoop EndIf wend ;wait for the PW dialog winactivate ("[CLASS:#32770]", "Open ") sleep (300) WinWaitActive ("[CLASS:#32770]", "Open ");filemaker PW dialog sleep (1000) winactivate ("[CLASS:#32770]", "Open ") ; i know this is redundent. send ("!n") sleep (1000) send ("{backspace}") sleep (1000) send ("!p") sleep (1000) send ("password") sleep (1000) send ("{enter}") <--a good way to start you day
JohnOne Posted January 16, 2012 Posted January 16, 2012 "the script was paused on a "winwaitactive""Because if no-one is logged in, the active window will always be the login screen. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
RogerRabbitsClone Posted January 16, 2012 Author Posted January 16, 2012 so, is there a solution that you can think of? <--a good way to start you day
JohnOne Posted January 16, 2012 Posted January 16, 2012 You could try replacing WinWaitActive with WinWait, and Send with ControlSend. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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