Windows Scheduled Task and Windows Form application

1

I have a windows form application that is using a WebBrowser control, I want to run this in a schedulded task on my windows 7 machine, but when I run it, the program doesn't seem to save any web pages (which is what the application is supposed to do)

I've been reading up and at this point I"m not even sure if this is possible, does anyone know how to accomplish this?

Thanks,

Jay

Posted 2013-08-13T21:29:46.037

Reputation: 11

I'm having kind of the same behavior. I have a commandline tool, that launches a winforms application with a WebBrowser with DockStyle=Fill. Running the commandline through cmd works, but through Schedule tasks, it doesn't. Also not with given answer to use cmd.exe /k. In my case, when run through schedule tasks, the WebBrowser control is larger then the winforms, even though the DockStyle is set. – Mike de Klerk – 2015-01-12T14:28:30.600

Are you sure there is no problem when you run it as Normally ? – Amirreza Nasiri – 2013-08-13T21:53:39.490

Yes, when I lanuch it through the command line, I can see the pages been saved to files – Jay – 2013-08-14T01:18:29.573

Say what you did do, Exactly. Are you using your application from Command-Line?? – Amirreza Nasiri – 2013-08-14T03:11:47.890

I am using a Scheduled task to launch the program via command line passing in 2 arguments, the application is a windows forms application because it uses the WebBrowser control – Jay – 2013-08-14T20:36:55.120

Answers

0

You have to set Action program to 'cmd.exe' then you can put your application path and argamets like :
cmd.exe /k [PATH2APP] [ARGAMENTS]

Amirreza Nasiri

Posted 2013-08-13T21:29:46.037

Reputation: 2 418

I'm not sure I fully understand your solution. This is a widnows form application, are you saying cmd.exe /k "C:/scraper/scraper.exe" "argument1" "argument2" - like this? – Jay – 2013-09-03T14:26:06.307

Yes! but argaments must be out of <"> symbols. – Amirreza Nasiri – 2013-09-03T14:35:01.137

I tried the way that I though you mentioned, and still not saving any files to the hard drive. No error messages are being logged either – Jay – 2013-09-03T14:41:32.800