Jump to content

No popup while schedule to run


ericcsc
 Share

Recommended Posts

Hi

I'm not sure what has happened when I scheduled to run the complied EXE, the program ("JTB FlexReport LT 1.1 by JTB World") did not popup to run however when I manually run, everything work well.

Additionally, I have tried changed to ShellExecute or to create a shortcut with the option to max program but this does not help at all.

Can anyone help to "enable" the popup of "JTB FlexReport LT 1.1 by JTB World" program. Thank you.

Run("\\server1\\JTBFlexReportLT\\Windows\\JTB FlexReport LT.exe")

WinWaitActive("JTB FlexReport LT 1.1 by JTB World")
Send("{LCTRL}W")
ControlClick("JTB FlexReport LT 1.1 by JTB World", "", "[Name:ButtonXShowHTML]")
WinWaitActive("JTB FlexReport - Windows Internet Explorer")
Sleep(100)
Link to comment
Share on other sites

Hi ericcsc,

  You mentioned Schedule, where is that part of the script?

does this part work w/out the schedule part?

  As a rule I always get the basics working before adding the bells and/or whistles.

Get the prgram to start with the above script and then add the scheduler.

BTW noone that doesnt have the above prog can test your script...

Bill

Edited by billo
Link to comment
Share on other sites

Hi ericcsc,

  You mentioned Schedule, where is that part of the script?

does this part work w/out the schedule part?

  As a rule I always get the basics working before adding the bells and/or whistles.

Get the prgram to start with the above script and then add the scheduler.

BTW noone that doesnt have the above prog can test your script...

Bill

 

Hi Billo

It is from Microsoft windows scheduler task created to run the complied exe file.

The script or complied exe file does work well when i manually run them, popup and run.

However when I used windows scheduler task, there isn't any popup of ("JTB FlexReport LT 1.1 by JTB World") program.

I tried to create a batch file to run from scheduler task and there is no pop-up.

Link to comment
Share on other sites

Your script works fine but the scheduler doesnt?

Then you will have to take a look at your scheduler settings

I just ran a MS scheduler test with this script comiled to exe with Windows 7 32 bit and it worked fine.

 

MsgBox(0, "", "Script Schedule Success")

So try it and see if your scheduler is working correctly. you also have the network ping to deal with dont forget.

Make sure your WinWaits are working, try replacing them with long pauses 4-5 seconds long to test where the problem is.

good luck,

Bill

Link to comment
Share on other sites

When you set up the task in Task Scheduler did you check the box to run only when the user is logged on or run whether or not the user is logged on? If you checked to run whether or not the user is logged on, you will not see any activity, but you should be able to see the process running in task manager.

Link to comment
Share on other sites

I have tried that on Win7 Enterprise 32bit and Win8Pro 64b , the script does work well.

The schedule task did checked to run whether or not the user is logged on and with highest Admin rights too, but no popup.

I have increased the long pauses to 4 seconds, but still can't see any pop-up. On task manager, I can see the exe is running.

Additional, I have inserted "MsgBox(0, "", "Script Schedule Success")" into the script and complied again but did not see any pop-up even added in the first line. However I run manually, the message did popup.

Link to comment
Share on other sites

If you're not logged on, WinWaitActive and Send won't work. Also, unless the task is set to interact with the desktop user (session 1), none of your pop ups (msgboxes etc.) will be seen by the user.

See more here:

http://www.mockbox.net/windows-7/473-windows-7-run-scheduled-task-interactively

http://superuser.com/questions/278233/windows-7-task-scheduler-to-start-application-in-user-session

One of these might help with this.

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

Link to comment
Share on other sites

The schedule task did checked to run whether or not the user is logged on and with highest Admin rights too, but no popup

As allSystemsGo stated:

When a task is started from the Windows Task Scheduler with "Run whether user is logged in or not" selected, the process kicks off as a background process.

This means you will not see the application as it is not interactive.

Which means you cannot click on the MsgBox.

Which means you program will sit forever waiting to be clicked.

Link to comment
Share on other sites

As allSystemsGo stated:

When a task is started from the Windows Task Scheduler with "Run whether user is logged in or not" selected, the process kicks off as a background process.

This means you will not see the application as it is not interactive.

Which means you cannot click on the MsgBox.

Which means you program will sit forever waiting to be clicked.

This.

Link to comment
Share on other sites

Scheduled tasks will run on session 0, if you do not specifiy to 'run only when user is logged on' (and then again, maybe even with this option...)

on session 0, windows will never be 'active'...you should instead wait for it to 'exist' and become 'enabled'

Use the following:

BitAnd
WinGetHandle
WinGetState

http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F

You could always set the scheduled task to run the exe via PSEXEC or PAEXEC, with the interactive flag turned on....that will show the gui to the user session (again, assuming you have 'run only when user is logged on'

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...