Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Launch batch file in Task Scheduler at 16.30 every day (or other option)

Posted on 2007-10-18
13
Medium Priority
?
2,005 Views
Last Modified: 2008-04-21
I have a batch file Batch.bat that I am trying to launch at fixed intervals through Task Scheduler.
The batch file shall be run everyday at 16.30.
The batch file is run on a Windows 2003 Server.
Location of Batchfile: D:\Program.
The batch file is used to launch verious Excel applications. I have run the batch file manually and it does what it is intended to do, but when it is launched though Task Manager the application is not visible and no outcome is produced. Excel is visible as  a process in Task Manager once the process is running and has to be removed manually to end the process. In the Task Schedule folder the batch file appears to be running and the process is never ended.
0
Comment
Question by:ecgabrielsen
  • 7
  • 5
13 Comments
 
LVL 9

Expert Comment

by:divinewind80
ID: 20104168
The default process length is 72 hours.  So, check this on the task settings... adjust this, and the process should end at your specified time.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20104318
Presumably you are expecting to interact with the Excel applications at this time, or are they supposed to be running a macro perhaps then saving themselves?

If they are to be running themselves it could be when run as the user you are running them as Excel does not enable macros to run or is sitting there waiting the application for a user prompt effectively.

Have you tried scheduling it using scheduled tasks but using the same user/password that you are logged in to the server as (or login to the server using the one it is scheduled with) as tasks scheduled under a different user won't appear.

Steve
0
 

Author Comment

by:ecgabrielsen
ID: 20104358
I have adjusted process length to 7 hours. The main problem, however is that the program does not appear to launch. Eventhough the batch file as well as the Excell file it triggers are running according to the Task Scheduler as well as the Task Manager the program is not visible.
The process bach file remains visible in Task Manager despite the 7 hour limit.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:ecgabrielsen
ID: 20104437
You are correct Steve! That is my intention exactely. The batch file runs various macros and queeries in Excel and saves. Unfortunately the user running the process in Task Scheduler is the same as the user I am logged into the server as (Administrator), as is the password.

Neither the batch file nor Excel are visible when the process is launched through Task Scheduler.
Neither manual nor automatic launch through Task Scheduler seems effective.

Regards,
Erling.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20104576
OK, go into the proerties of the Task Scheduler service in Computer management,  Check in the login tab that the "interact with desktop" is checked.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20104593
Or it seems are you sure it is the SAME administrator, i.e. local / domain ?
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 20104665
As long as the user is the same it would appear excel starts as expected... ignore the "interact with desktop" bit above.  Perhaps try it with:

Create a new local user, make it an administrator
login with this user
Create the task as that user
Schedule it to kick of in a minutes time.
0
 

Author Comment

by:ecgabrielsen
ID: 20104684
1) Interact with desktop is selected in login tab
2) Administrator is in the same domain
0
 

Author Comment

by:ecgabrielsen
ID: 20104725
I have also tried to launch the application through the following command (which I found on this site):
AT 16:30 /every:M,T,W,Th,F,S,Su D:\Program\Batch.bat.
This resulted with the process being added in the Task Schedule with the appriate times, but with System User as launching user. This was not successful either.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20104786
If you use the AT command you'll need to add /interactive to the command line I think.  Assuming this isn't an AD domain controller can you try it with a specific local user created for the purpose as suggested above?
0
 

Author Comment

by:ecgabrielsen
ID: 20104977
Hi Steve,

I tried what you suggested and the file was launched successfully!
I need to check up some passwords tomorrow as my sql queery could not access the server with a new user name (it downloaded data as Trusted User, but as the existing user does not exist in the sql it will needt to access it as SA user, whose password I should get tomorrow.)

Do you have a suggestion as to why I was unable to run this process with the administrator user? The same user has been able to launch other applications through Task Scheduler successfully.

Erling
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20105066
It shouldn't matter as long as the same domain/local and username combination is used by the logged in user (to see what is happening) and run the scheduled task.

Other than that might be a profile issue I suppose?

Short answer, don't know!

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 20105083
Thanks for choosing my answer BTW, didn't notice the second email before.

Steve
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question