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?
LVL 4
davekyAsked:
Who is Participating?
 
bruintjeCommented:
Hi daveky,
----------

if you run it in the context of the logged on user you could try
source: http://www.jsifaq.com/SUBJ/tip4500/rh4579.htm

----------
bruintje
share what you know, learn what you don't
0
 
davekyAuthor Commented:
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?)
0
 
bruintjeCommented:
:)

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]
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
davekyAuthor Commented:
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?
0
 
davekyAuthor Commented:
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.
0
 
bruintjeCommented:
i've only used this with a local admin account not a simple user
0
 
davekyAuthor Commented:
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.
0
 
bruintjeCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.