Jump to content

scripting in windows home server. WHS not accepting input from send


Recommended Posts

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 autoiters

here 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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...