Asked by:
Program runs fine, but task scheduler won't run it

Question
-
I am running Win Server 2008 R2. I have a console app that I wrote, which runs just fine when I click on ConsoleApp1.application file. I want the task scheduler to run this console app every ten minutes, so I set up a task using task scheduler. Whenever the task scheduler tries to run it, though, it fails, and return an erro rmessage "%1 is not a valid Win32 application. (0x800700C1)".
Most of what I've found in searching talks about making this stuff work on IIS, but I'm not using IIS. I'm just running a pretty plain ol' vanilla console app.
This is a console app, not a web app. I've set the task up as a Windows 2008 R2 task, using Domain Administrator credentials, with "Run with highest privileges" checked. I'm not sure what else to do. Can someone provide some other advice to try?
Friday, November 12, 2010 8:28 PM
All replies
-
I have the same problem - was there ever a resolution for this?
Thank you!
Friday, December 17, 2010 7:06 PM -
Sadly, no. But what I've read leads me to believe that it has to do with the fact that it's a 32-bit app. I have a 64-bit development machine on order. When it gets here I'm going to recompile my app as a 64-bit app and see if that solves the problem. I'll let you know.Friday, December 17, 2010 7:22 PM
-
Hi ScottDarth,
I was wondring if there was any resolution to your issue. What I am up against is very similar. I have a windows application written in VB.NET 3.5, it uses Excel Libraries to work with Excel. When I run it as a stand alone application it works flawlessly, but when scheduled through Task Scheduler, it just hangs. In Task Manager I can see that it has created a handle on Excel application, but then it doenst move forward.
I have read though numerous posts but havent come to a conclusion. The Excel is a 32 bit installation, and my server is 64bit 2008 R2.
I would really appreciate any input.
Thank you
Tuesday, March 8, 2011 1:51 PM -
Sorry, I've not been successful with this at all. There doesn't seem to be any published resolution to this that I can find.Thursday, March 31, 2011 7:39 PM
-
Hi ScottDarth,
I've seen something similar, basically taskscheduler assumes that the applicaiton is 64 bit. If it is 32 bit then try launching it from the 32 bit command line, i.e. if you want to run c:\program files (x86)\Myprogram\Program.exe, tell taskscheduler to launch:
%systemroot%\Syswow64\cmd.exe /C "c:\program files (x86)\Myprogram\Program.exe"
This forces it to launch from the 32 bit command-prompt and hence with 32 bit emulation.Regards,
Nick
- Proposed as answer by jonNZ Thursday, September 1, 2011 9:20 PM
Monday, August 1, 2011 3:14 PM -
Hi pattmania,
I was in the same issue. So I tried with your solution and finally it works for me.
I created a simple .bat file that launches my console app and it's working now.
Thank you very much!
Lawrence
Monday, June 4, 2012 3:18 PM -
Try to change the version of the console application to 32 bit.
i.e. Right click Goto -> Properties -> Build -> Platform Target = x86.
Rebuild the application and run the scheduler. it should work now...
Thursday, June 19, 2014 5:08 PM -
THIS WORKS. I created a 2013 console app to run an SSIS package. For various reasons the app had to remain as 32 bit. I COULD not get Task scheduler to work until I tried this remedy. Thank you so much.Tuesday, June 30, 2015 10:46 AM
-
Hi ,
I am not sure if this is still an issue with you . But I had this problem for longest time and it took me a while to get to the solution . So posting it here for someone who may need it .
Create these two folders:
32Bit:
C:\Windows\System32\config\systemprofile\Desktop
64Bit:
C:\Windows\SysWOW64\config\systemprofile\Desktop
Excel needs these folders if it's not run interactively. Create both folders even if you are on a 64-bit OS.
Thursday, February 2, 2017 7:11 AM -
Our problem was the EXTENSIONS were hidden on our servers - so when I asked for a scheduled task to be created (on a 'new' server) the person who created it for me thought he was selecting 'file.exe' but he actually selected 'file.exe.config' (b/c it wasn't displaying the .config. bit in File Manager).
WHY is that the default on a SERVER?
Wednesday, May 30, 2018 1:04 PM -
I had similar problem, but managed to fix it when changed in task properties: Start in (optional) value to my aplication location. Without it, the task sheduler runs in system32 folder but my program wont have privileges to run in system32.
- Proposed as answer by MrKawaiiKun Tuesday, May 14, 2019 12:21 PM
Friday, June 29, 2018 8:51 AM -
David, this is totally unrelated but I just had to say something since we have nearly identical names.
Cheers!
Thursday, September 20, 2018 12:23 PM -
It works for me too. Really appreciate you help!Wednesday, October 10, 2018 9:02 AM
-
I am running Win Server 2008 R2. I have a console app that I wrote, which runs just fine when I click on ConsoleApp1.application file. I want the task scheduler to run this console app every ten minutes, so I set up a task using task scheduler. Whenever the task scheduler tries to run it, though, it fails, and return an erro rmessage "%1 is not a valid Win32 application. (0x800700C1)".
Most of what I've found in searching talks about making this stuff work on IIS, but I'm not using IIS. I'm just running a pretty plain ol' vanilla console app.
This is a console app, not a web app. I've set the task up as a Windows 2008 R2 task, using Domain Administrator credentials, with "Run with highest privileges" checked. I'm not sure what else to do. Can someone provide some other advice to try?
Wednesday, January 2, 2019 7:48 PM -
Jen, your a lifesaver for this info, I was going nuts trying to find out why I couldn't get it to work.Wednesday, February 13, 2019 2:09 PM
-
I had similar problem, but managed to fix it when changed in task properties: Start in (optional) value to my aplication location. Without it, the task sheduler runs in system32 folder but my program wont have privileges to run in system32.
This did the trick for me, thanks so much.
Tuesday, May 14, 2019 12:21 PM -
I observed similar situation. You need to insure "Run with highest privileges" box in "Security options" is checked!Wednesday, May 15, 2019 3:39 PM
-
Hi Joel Lepp,
I also tried the same and it worked for me.
- Edited by shades443 Monday, September 9, 2019 4:35 AM
- Proposed as answer by JohnWick2027 Monday, December 16, 2019 6:09 AM
- Unproposed as answer by JohnWick2027 Monday, December 16, 2019 6:10 AM
Monday, September 9, 2019 4:34 AM -
I had the same problem.
Running on Windows Server 2008.
Tried all the solutions proposed here, and from other forum. Nothing works.
The only thing that worked for me, was to convert the BAT to EXE.
Then it run perfect.
Somehow, I dont know if it was an update from Windows or what, but from one minute to another, Taskman started to have this issue, and this was the only thing that made it work again
Hope it helps
Regards!
Monday, December 16, 2019 6:15 AM -
This worked for me thanks!Wednesday, October 28, 2020 12:04 PM