Jump to content
Sign in to follow this  
autoItAll

automate GUI run as scheduled task logged off and not admin

Recommended Posts

autoItAll

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
blademonkey

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
autoItAll

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
blademonkey

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
Danny35d

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
autoItAll

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
Danny35d

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
pwpeterson

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
MHz

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
pwpeterson

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
hotkidd

It's 2018 now, and anyone knows how to solve this issue? i.e. to run a GUI involved script without user logged on?

Share this post


Link to post
Share on other sites
BrewManNH

What are you trying to do in the script? With that information we'd at least have a ghost of a chance to answer you.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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  

×