Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing From a Scheduled Task

Status
Not open for further replies.

VB400

Programmer
Sep 8, 1999
359
US

I have a VB program that is setup to run via Windows NT's Scheduled Tasks. The program basically generates a report that we want to print at night and have it ready on the user's printer first thing in the morning. When setting up the Scheduled Task, we give it an account name and password

Here's the problem:

Since we run the program at night when nobody is logged on to the workstation, it seems that the printer assignment/mapping doesn't take place thus the report which is created in Crystal Reports and VB6 is never sent to the printer. If the same scheduled task runs while someone is logged on to the workstation, it goes to the default printer of the user logged on.

Any help would be greatly appreciated. Tarek
 

This may take a lot of discovery on your part but I believe that you can do this by "Impersonating a User". I could be wrong but I believe that you can have your program logon to the computer as a user and it will have its own settings that you can set up i.e. default printer and such.

Good Luck!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top