1

I have an exe file which runs OK when I double clik on it (even when not Admin mode)

When I run it through win-task-scheduler it fails right at the start.

(I see it fails on configuring Nhibernate)

1) How can I configure the scheduler to run in elevated mode?

2) If that doesn't help - any other idea?

enter image description here

Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • 2
    You cut out the most important part of the error. The stack trace doesn't tell us much. Elevated mode? No. You need to figure out 1) what rights your executable requires in order to run and then 2) provide those specific rights to the account that is executing your application. Don't use a shotgun to drive a nail. –  Apr 02 '12 at 14:22
  • I've found that if the error message doesn't tell you the problem, the event log usually does in cases like this (running from a scheduled task, windows service, etc.) – Dismissile Apr 02 '12 at 14:24
  • @Will didn't cut, that's all I can see. It's forzen. How can I give specific rights? – Elad Benda Apr 02 '12 at 14:25
  • You could try to run the debugger from the program while it runs under the scheduler, look here http://stackoverflow.com/questions/588946/how-do-i-debug-an-exe-running-through-windows-scheduler – Doc Brown Apr 02 '12 at 14:26
  • I think you can run a scheduled task elevated by using the "Run with highest privileges" checkbox on the task properties dialog. I have no idea if that's the underlying problem, though. – Ian Gilroy Apr 02 '12 at 16:40

1 Answers1

2

To run in elevated mode:

http://www.howtogeek.com/howto/windows-vista/create-administrator-mode-shortcuts-without-uac-prompts-in-windows-vista/

Check the box named "Run with highest privileges"

Joe DF
  • 5,438
  • 6
  • 41
  • 63
  • in general, how to I exec the cmd in elevated mode? `cmd.exe -admin` ? – Elad Benda Apr 03 '12 at 06:00
  • Right click a cmd shortcut and run as admin OR right click properties -> Advanced -> the check the box "run as admin" OR check this link: http://answers.yahoo.com/question/index?qid=20080819202757AAK2yvc – Joe DF Apr 03 '12 at 21:33
  • so check the link, i gave, that method it through command prompt. basically it is: runas /noprofile /user:mymachine\YOUR-USERNAME-HERE cmd.exe – Joe DF Apr 03 '12 at 21:40