Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

.NET GUI Application does not run using Task Scheduler when user is logged off

Posted on 2006-11-06
4
Medium Priority
?
439 Views
Last Modified: 2008-01-16
I have a .NET GUI Application that runs successfully via Task Scheduler when I am logged in or the PC is locked but it does not work when I am logged off (PC is still running) I verified that a different app (console based) that simply deletes a DIR runs fine even when I am not logged in.

I know that the App. runs in invisible mode when run by Task Scheduler when the user is not logged in. Is it an issue if the GUI Application uses Button.PerformClick() to trigger certain application logic? The application also launches a broswer window if needed, would this be an issue?

Thanks in advance for your help.
0
Comment
Question by:mubeen76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
qz8dsw earned 500 total points
ID: 17886711
hokies, I think I'm right on these assumptions,

Sounds like it would be alot better suited to be a service in XP and just have a timer based trigger.
However you have to realise you actually have no buttons, it has no gui or desktop to start on when you are logged off so no where to place it's form even though it's invisible. Using form based trigger then I would expect to fail.

Launching a browser would be much the same, it might be able to launch it, but wether it could interact with it the way you want is another thing entirely.

I used a service to interact with Word via ADO which works fine, A scheduled event just did not work for much the same reasons you are striking.
I had to give the service a proper username and password so it could load a profile to interect with.
Because it used network resources (Much like yours would be with a browser I'm assuming) it would need a valid username and password that could use the network. The localsystem account for a service although has full access to the local machine, it has totally no access to anything on the network.

I hope this helps.

Terry
 

0
 
LVL 15

Expert Comment

by:qz8dsw
ID: 17886722
Well, or you could re-write it not to depend on or use gui based triggers.
0
 

Author Comment

by:mubeen76
ID: 17890096
hmm.. thanks qz8dsw. Is there a way I can tell in my application if it required the Task Scheduler to login? The thing is I want the user to possibly interact with the UI when the Task runs when the user is logged in but have it run in console mode when the user is not logged in.

0
 

Author Comment

by:mubeen76
ID: 17893559
I found a way to test if the application is running in invisible mode. When I call ShowDialog it throws the exception below and I can hence infer the mode. Thanks!

System.InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at CEASIRLoader.frmMainPage.frmMainPage_Load(Object sender, EventArgs e)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question