Solved

Schedule Task at window 2000?

Posted on 2004-08-22
11
137 Views
Last Modified: 2010-05-02
Hi All,

I have used Visual Basic 6.0 to develop a window application before. Now I would like to schedule this application to run at 1:00am everyday.

I know I can do this by adding a schedule task by using "Scheduled Tasks" at control panel.

But I found the application can work only after logging the OS.
I want the application can be run properly if I have power on my PC without log in.

How can I solve this problem?

If I run my application as a service, can this solve my problem?
Can a service be scheduled to run periodically?

Please advice. Thanks!

0
Comment
Question by:cplau
  • 6
  • 4
11 Comments
 
LVL 7

Expert Comment

by:suramsureshbabu
Comment Utility
Idealy the program would be designed to run as a service, but not all of them are. You have to be carefull with this however. Not all programs run well as a service - VB apps for example are not recommended to be run as a service.
There is a utility called srvany that will probably work for you. It is available as a download at Microsofts web site

0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Your application should normally be running even if you are not logged in. A mistake often done by programmers is that resources (mapped drives, printers, ...) are not available when not logged in.

Start by creating an application that does nothing and schedule it. You should see that the application will be launched. Then add your code to this application with a lot of tracing (wrtiting to a .log file on the C: drive) to know exactly where the application is going and where it is stopping.
0
 

Author Comment

by:cplau
Comment Utility
Hi All,

If I run my application as a service, can I schedule it to run periodically?
I know I can use Scheduled Task to run an exe file periodically. How about a service?

Thanks!
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
A service is yet another thing and have more  limits! Also, Windows Services should be written in VB.Net to be easier.

0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Did you trace your application yet?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:cplau
Comment Utility
Dear emoreau,

My application needs to use a network drive.
Can I map a network drive without log in the OS?

Further, please advise whether a service can be scheduled or not?
Thanks!

0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
>>Can I map a network drive without log in the OS?

If you can give credentials.

can't you use a URN: \\servername\sharename\folder\
0
 

Author Comment

by:cplau
Comment Utility
Dear emoreau,

Could you give me the source code to use URN to map a network drive?

Thanks!
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 

Author Comment

by:cplau
Comment Utility
Dear emoreau,

The most important question:

A service at window 2000 can be scheduled to run at a specified
time or not?

Thanks!
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 200 total points
Comment Utility
Not a service. Only an application.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now