spikehartunian Posted April 7, 2007 Posted April 7, 2007 dear all, I am just a few days old when it comes to scripting, so please be gentle with the techie speak! :-) I absolutely love the program but need help with something. I have a script that I need to run overnight. Problem is my computer is locked and the script just goes into pause. I looked at other Forum entries regarding this but they seemed quite old so thought I would ask again in case there was some new information. Essentially, is there either a way to force a script to run while a PC is locked or can you unlock a PC within the script, run and then lock the PC back up again? Unfortunately, the script does require some kind of user input in the middle, which I have added into the script. Any help gratefully received.
Uten Posted April 7, 2007 Posted April 7, 2007 How is the computer locked? What happens when it is locked. Do you have to log in again? Is there a program doing this? Does the computer hibernate? What is your OS? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
spikehartunian Posted April 7, 2007 Author Posted April 7, 2007 How is the computer locked? What happens when it is locked. Do you have to log in again?Is there a program doing this?Does the computer hibernate?What is your OS?the computer is locked by pressing ctrl-alt-del and then selecting lock this computer under Windows XP. It sits on a network domain so when you unlock it you type in your network username and password which is the same account you locked it under. The computer doesn't hibernate, it sits there locked.Hope this answers your question.
Uten Posted April 7, 2007 Posted April 7, 2007 I don't have XP but from what I have seen it should let your script run as long as it does not need GUI interaction. maybe you could try this little script in SciTe. Lock your computer, wait a few secs then log in back and analyze the output. HotKeySet("{ESC}", "Terminate") Local $count = 0 Local $start = TimerInit() Do dbg(Round(TimerDiff($start),0)) $count += 1 sleep(1000) Until $count = 1000 Func Terminate() Exit EndFunc Func dbg($msg, $line=@ScriptLineNumber, $err=@error, $ext=@extended) ConsoleWrite("(" & $line & ") := (" & $err & ")(" & $ext & ") : " & $msg & @CRLF) EndFunc Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
spikehartunian Posted April 7, 2007 Author Posted April 7, 2007 I don't have XP but from what I have seen it should let your script run as long as it does not need GUI interaction. maybe you could try this little script in SciTe. Lock your computer, wait a few secs then log in back and analyze the output. HotKeySet("{ESC}", "Terminate") Local $count = 0 Local $start = TimerInit() Do dbg(Round(TimerDiff($start),0)) $count += 1 sleep(1000) Until $count = 1000 Func Terminate() Exit EndFunc Func dbg($msg, $line=@ScriptLineNumber, $err=@error, $ext=@extended) ConsoleWrite("(" & $line & ") := (" & $err & ")(" & $ext & ") : " & $msg & @CRLF) EndFunc Thanks, but unfortunately user GUI interaction is needed. My script logs onto another application, does some stuff, logs off and manipulates the data and emails it using outlook.
Uten Posted April 7, 2007 Posted April 7, 2007 And the other application is not halted? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
spikehartunian Posted April 7, 2007 Author Posted April 7, 2007 And the other application is not halted?Which other application? The one I am trying to use in the script? It doesn't get that far, as soon as the script starts it pauses and sits in my systray.
Uten Posted April 7, 2007 Posted April 7, 2007 OK, something else is on. Time for you to post some code I'm afraid! What was the result when you tried the code I provided? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
spikehartunian Posted April 7, 2007 Author Posted April 7, 2007 OK, something else is on. Time for you to post some code I'm afraid! What was the result when you tried the code I provided?Can't try the code you posted until Tuesday as I need to be at work. Here is the code though, don't laugh, I did say I was new to this! :-) I've had to blank out passwords and emails.;Launch MTRun("C:\Program Files\MEDITECH\Workstation3.x\T.exe")WinWaitActive("MEDITECH Remote Workstation")Sleep(1000);Log inSend("1{ENTER}")Sleep(500)Send("username{ENTER}")Sleep(500)Send("password{ENTER}")Sleep(500);LAB NPRSend("8{ENTER}")Sleep(500)Send("11{ENTER}")Sleep(500)Send("LAB.L.SPEC{ENTER}")Sleep(500)Send("andi.lab.outstanding{ENTER}")Sleep(500)Send("4{ENTER}")Sleep(500)Send("{ENTER}")Sleep(500)Send("T{ENTER}")Sleep(500)Send("T-28{ENTER}")Sleep(500)Send("ATDump{ENTER}")Sleep(120000)Send("{ENTER 3}");Copy ATDumpFileCopy("C:\ATDump.txt", "C:\LABCensus.txt", 1)Sleep(10000);MIC NPRSend("LAB.M.SPEC{ENTER}")Sleep(500)Send("andi.lab.outstanding{ENTER}")Sleep(500)Send("4{ENTER}")Sleep(500)Send("T{ENTER}")Sleep(500)Send("T-28{ENTER}")Sleep(500)Send("ATDump{ENTER}")Sleep(120000)Send("{ENTER 3}");Copy ATDumpFileCopy("C:\ATDump.txt", "C:\MICCensus.txt", 1)Sleep(10000);PTH NPRSend("LAB.P.SPEC{ENTER}")Sleep(500)Send("andi.lab.outstanding{ENTER}")Sleep(500)Send("4{ENTER}")Sleep(500)Send("T-28{ENTER}")Sleep(500)Send("ATDump{ENTER}")Sleep(120000)Send("{ENTER 8}");Copy ATDumpFileCopy("C:\ATDump.txt", "C:\PTHCensus.txt", 1)Sleep(10000);Launch OutlookRun("C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE")WinWaitActive("Inbox - Microsoft Outlook")Sleep(3000);Create emailSend("^M")Sleep(500)Send("xxx@xxx.xxx;{ENTER}")Sleep(1000)Send("{TAB 3}")Send("Lab Outstanding Test Census")Send("{TAB}")Send("A message for the body of the email");Attach filesSend("{ALTDOWN}")Sleep(500)Sleep(500)Send("I")Sleep(500)Send("F")Send("{ALTUP}")Sleep(2000)Send("C:\LABCensus.txt")Sleep(500)Send("{ENTER}")Sleep(500)Send("{ALTDOWN}")Sleep(500)Send("I")Sleep(500)Send("F")Send("{ALTUP}")Sleep(2000)Send("C:\MICCensus.txt")Sleep(500)Send("{ENTER}")Sleep(500)Send("{ALTDOWN}")Sleep(500)Send("I")Sleep(500)Send("F")Send("{ALTUP}")Sleep(2000)Send("C:\PTHCensus.txt")Sleep(500)Send("{ENTER}")Sleep(500);Send emailSend("!S")Sleep(2000);Quit outlookSend("{ALTDOWN}")Send("F")Sleep(500)Send("X")Send("{ALTUP}"); Finished!
Uten Posted April 7, 2007 Posted April 7, 2007 This window will never become active WinWaitActive("MEDITECH Remote Workstation"). Better rewrite your script to use ControlSend(..) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
spikehartunian Posted April 7, 2007 Author Posted April 7, 2007 This window will never become active WinWaitActive("MEDITECH Remote Workstation").Better rewrite your script to use ControlSend(..)So how does ControlSend work?
Uten Posted April 7, 2007 Posted April 7, 2007 Your installation did not come with a help file? If it did not, reinstall.. You can find the controlID's with au3info.exe in the AutoIt folder. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
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