Link to home
Start Free TrialLog in
Avatar of daveky
daveky

asked on

Windowless process?

I have a process I want to run every few minutes. Windows Task Scheduler is the obvious trigger. I have written a c# console application which does the work but of course it pops up a window! Is there any way to have a c# exe run by the WTS without it needing/creating a console window?
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of daveky
daveky

ASKER

It will be run on a server where there is no logged on user most of the time. So, are we saying it would only popup (if it ran under my account) if I was logged on?* That really, there is not an issue here? And, if I ran it under a specific user account that was never used to log on (or couldn't) that it would never pop up?

(ahahaha: if a tree falls down and there is no one there does it make any sound? We've created anew philosophical question here: If a window pops up and there is no one logged on to see it, does it pop up at all?)
:)

if i where you just test to be sure, i know for fact that my scheduled tasks will run even if i'm not logged in on the server [windows 2003]
Avatar of daveky

ASKER

This is making sense. I was testing the task/exe by running it locally under may account while I was logged on. When you create the task you specify which account to run under and there is a check box to specify whether to run "Only if logged on". When you uncheck this the Specify Password button is available.

Unfortunately the status of the task never gets past "Could not start" when I set up a specific user to run the task. There is nothing in the machine logs to suggest why. Any ideas?
Avatar of daveky

ASKER

I found the task sheduler log (c:/windows/schedlgu.log). It has this:

"abc.job" (abc.exe) 25/05/2006 12:20:24 ** ERROR **
      Unable to start task.
      The specific error is:
      0x80070005: Access is denied.
      Try using the Task page Browse button to locate the application.

So I guess the account does not have permissions to run the exe. Which is weird.
i've only used this with a local admin account not a simple user
Avatar of daveky

ASKER

It's runs OK if I give the account Administrator access (which isn't ideal), but hey-ho. Cheers, for pointing me in the right direction.
glad it works out, i'm not deeply into the security implications of running jobs on the scheduler it probably just needs stronger credentials running silent then a normal user would have

thanks for the grade