Sign in to follow this  
Followers 0
autoItAll

automate GUI run as scheduled task logged off and not admin

10 posts in this topic

Hi. I have an issue similar to:

http://www.autoitscript.com/forum/index.php?showtopic=18026

I need to run some autoIt scripts (they open up iexplorer and go to sites to download these excel reports) from a .bat file that is executed as a scheduled task. Only problem is I'd like to do it while not logged in. Thred above said to run task as admin, but not possible. Is there anyway to run these GUI manipulating scripts as a scheduled task while not logged in as just a power user? If anyone has any help I will be your best friend ever. :)

Share this post


Link to post
Share on other sites



Hi. I have an issue similar to:

http://www.autoitscript.com/forum/index.php?showtopic=18026

I need to run some autoIt scripts (they open up iexplorer and go to sites to download these excel reports) from a .bat file that is executed as a scheduled task. Only problem is I'd like to do it while not logged in. Thred above said to run task as admin, but not possible. Is there anyway to run these GUI manipulating scripts as a scheduled task while not logged in as just a power user? If anyone has any help I will be your best friend ever. :)

Why is it not possible?

how about doing a runaset in the autoit script?


---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

Why is it not possible?

how about doing a runaset in the autoit script?

Thank you for your timely response. I tried running the .bat file as a scheduled task running under admin while logged out just for fun. Still no workey. :) So I think the real issue here is. . .is it even possible to run some crazy mouse moving and clicking fun GUI scripts as a scheduled task while logged off. The task runs beautifully when I'm logged on, but as soon as I try to test it logged off, no go. When I log back on after an extended wait period excessively greater than the amount of time needed to run the script, scheduled task manager says the script is "running" but I think it is lying to me, because I see no evidence of the process. If it is not possible to do this kind of script while logged off-is there an autoIt logMeOn?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thank you for your timely response. I tried running the .bat file as a scheduled task running under admin while logged out just for fun. Still no workey. :) So I think the real issue here is. . .is it even possible to run some crazy mouse moving and clicking fun GUI scripts as a scheduled task while logged off. The task runs beautifully when I'm logged on, but as soon as I try to test it logged off, no go. When I log back on after an extended wait period excessively greater than the amount of time needed to run the script, scheduled task manager says the script is "running" but I think it is lying to me, because I see no evidence of the process. If it is not possible to do this kind of script while logged off-is there an autoIt logMeOn?

That's tough to say. if a tree falls on a mime and no one is there to hear or see it, did it happen?

The point i am making is that if the Explorer is not invoked, then we cannot say whether or not the windows that your schedtask creates are actually being created, unless that tasks can output an error log that denotes otherwise.

Most GUI based programs will not run if you're not logged in. You'll need to automate a console application to get better results.

also keep in mind that the scheduled tasks agent runs EVERY scheduled tasks as the local SYSTEM account unless otherwise specified (from the Sched Task or the actual task standpoint).

-Blademonkey

PS: don't thank me until it's fixed. {= )

Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

need to run some autoIt scripts (they open up iexplorer and go to sites to download these excel reports) from a .bat file that is executed as a scheduled task. Only problem is I'd like to do it while not logged in.

The only way that you may be able to run your script even is not login is by running your script as a service or system process.

Func _RunAsSystemProcess($s_Command)
    If IsAdmin() Then
        Run(@ComSpec & " /c " & "sc create testsvc binpath= " & $s_Command & " type= own type= interact", "", @SW_HIDE)
        Run(@ComSpec & " /c " & "sc start testsvc", "", @SW_HIDE)       
        Return 1
    Else
        Return SetError(1, 0, 0)
    EndIf
EndFunc
I copy and paste the UDF from this post and remove the delete service part...

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

The only way that you may be able to run your script even is not login is by running your script as a service or system process.

Func _RunAsSystemProcess($s_Command)
    If IsAdmin() Then
        Run(@ComSpec & " /c " & "sc create testsvc binpath= " & $s_Command & " type= own type= interact", "", @SW_HIDE)
        Run(@ComSpec & " /c " & "sc start testsvc", "", @SW_HIDE)       
        Return 1
    Else
        Return SetError(1, 0, 0)
    EndIf
EndFunc
I copy and paste the UDF from this post and remove the delete service part...

I tried this, but I got this error (my test program was called "test.au3"):

Could not start the testsvc service on Local Computer

Error 193: 0xc1

I looked up the error and it is "Invalid Process" :)

Share this post


Link to post
Share on other sites

Did you compile you script? I don't think you will be abel to run test.au3, you will need to run test.exe


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

I am having the same problem and have tried this solution to no avail. Anyone else get this to run?

Basically I need the WINXP workstation to login to a server, run some coldfusion scripts, then perform a MySQL reload.

It works fine when I am logged in and run the script manually, but when I try yo schedule it it pauses from the git-go.

Any help would be apprciated.

Here's the script

Opt("TrayMenuMode",1)

run("C:\Program Files\AT&T Global Network Client\NetClient.exe")

WinWait("AT&T Global Network Client")

Sleep(2000)

Send("!C")

WinWaitActive("AT&T Global Network Client","0:20")

Run("C:\Program Files\Mozilla Firefox\firefox.exe http://websrvr01/cfusion/jdixReload/dailyUpdater.cfm")

WinWait("Daily Updater Done - Mozilla Firefox")

WinClose("Daily Updater Done - Mozilla Firefox")

WinActivate ( "AT&T Global Network Client" )

Send("!D")

WinWaitActive("AT&T Global Network Client","Do you want to disconnect from the network?")

Send("!Y")

WinActivate ( "AT&T Global Network Client" )

Send("!{F4}")

RunWait(@COMSPEC & " /c mysql-cghist-reload")

Run("C:\Program Files\Mozilla Firefox\firefox.exe http://websrvr01/cfusion/jdixReload/dailyFTP.cfm")

WinWait("Daily FTP Done - Mozilla Firefox")

WinClose("Daily FTP Done - Mozilla Firefox")

Share this post


Link to post
Share on other sites

I am having the same problem and have tried this solution to no avail. Anyone else get this to run?

Basically I need the WINXP workstation to login to a server, run some coldfusion scripts, then perform a MySQL reload.

It works fine when I am logged in and run the script manually, but when I try yo schedule it it pauses from the git-go.

Any help would be apprciated.

Would not a logoff script suit your need by using group policy?

Share this post


Link to post
Share on other sites

I should have been more clear. I am using remote desktop connection of access the workstation.

When I am logged in remotely, I can start the script and it runs fine.

When the script is scheduled to run and I am logged in, the script starts and runs fine.

When the script is scheduled to run and I am NOT logged in, the script starts and hangs.

How do I schedule the script and get it to run without logging in?

pwp

Share this post


Link to post
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
Sign in to follow this  
Followers 0