• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 599
  • Last Modified:

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?
0
daveky
Asked:
daveky
  • 4
  • 4
1 Solution
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now