Hello, I have a problem with this script (which is my first AutoIt script, by the way). What I want to do is automate a psexec command which will hibernate my other pc from remote. The command works, but since the other pc has no password, it prompts me for one. So I was trying to make AutoIt simulate the "enter" key to skip the password request. The script basically works, but the strange thing is, it opens two instances of the command prompt, each of them executes the psexec command but only one of them receives the simulated keystroke.
Here is the script:
Run(@ComSpec & " /c " & 'c:\Utility\Utilities\Pstools\psexec \\FUZZEEMADDER-PC -u Fuzzeemadder Rundll32 Powrprof.dll,SetSuspendState Sleep', "")
Send ("{ENTER}")
Sleep (30000)
ProcessClose ("psexec.exe")
ProcessWaitClose ("psexec.exe")
ProcessClose ("cmd.exe")
Can somebody help me? What am I doing wrong?