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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduled Task wont run unattended

Status
Not open for further replies.

TimK01

Technical User
Joined
Jan 4, 2002
Messages
94
I have created a small app that I want to run nightly
I have set it up in Scheduled Tasks and it runs fine, as long as I am signed on on the server (as the Administrator)!

If I sign off the job shows as having a Last Result of 0x1 and nothing appears to happen.

I have set the job to run as the Administrator on the task tab of the Scheduler to no effect.

The job has no user interface, but does require a network share to be in place which I have double checked by placing the app in a batch file that recreates the network share first.

If it makes any difference the app is written in V6. and accesses Access databases and uses CDO to send messages via Outlook.

ANy assistance or ideas greatly appreciated.

Tim
 
Hi,
if the appl is written by you,
implement a serious error-check routine:

on error returned by system-call

call GetLastError, and write on a file this value
and an identif. who tells you the label:

ie:

main()
....
if( Sys...() != 0 )
MyErrorRoutine("STEP1")
....

MyErrorRoutine(char *szLabel)
{
// fopen "a" errorfile
...
DWORD rc=GetLastError();

// optionally can call FormatMessage

fprintf( stream, "%d %s\n", rc, szLabel)
}

-------------------------------------------

Another sugg. is to test the access at the share,
in batch, without call your program, as dir \\myshare
and test if error at command level. (always using file)


bye


 
It could be the user id that the schedulled tasks are running under ? Try running the AT command with the /k switch - Q142040
 
Everything works with the Administrator signed on but fails with it signed off.

I dont want to leave the adminsitrator (or anybody) signed on at all times so. Is there any way to send email from a scheduled job when the server is not logged on?

I have so far tried MAPI & CDO.

I am aware of one scheduled task supplied by Microsoft that appears to send emails so it seems that it should be able to be done.

Any ideas anyone?
 
It sounds like the scheduler is set up to run in "Interactive mode", if it is, this requires an admin/user to be logged into the server in order for the sheduler to run. You want to make sure you are not running in "interactive mode".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top