|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
creating a scheduled task.Hi,
I am having problems in trying to create a scheduled task from within in application that carries out a health check on a client. I am using VS 2005. When the program runs it flashes a command prompt but does nothing. Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create /tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00 /ru ""System""") System.Diagnostics.Process.Start(task) Any help will be gratefully received Neil. Hello Neil,
> Hi, Is the application running as a non-administrator? If so this won't work > I am having problems in trying to create a scheduled task from within > in application that carries out a health check on a client. I am using > VS 2005. > When the program runs it flashes a command prompt but does nothing. > > Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create > /tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00 > /ru ""System""") > System.Diagnostics.Process.Start(task) > Any help will be gratefully received Neil. because you have to be an admin to run schtasks. Otherwise what is the return code of schtasks? -- Jared Parsons [MSFT] jared***@online.microsoft.com All opinions are my own. All content is provided "AS IS" with no warranties, and confers no rights. Jared wrote:
Show quoteHide quote > Hello Neil, Hi Jared,> > > Hi, > > I am having problems in trying to create a scheduled task from within > > in application that carries out a health check on a client. I am using > > VS 2005. > > When the program runs it flashes a command prompt but does nothing. > > > > Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create > > /tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00 > > /ru ""System""") > > System.Diagnostics.Process.Start(task) > > Any help will be gratefully received Neil. > > Is the application running as a non-administrator? If so this won't work > because you have to be an admin to run schtasks. > > Otherwise what is the return code of schtasks? > > -- > Jared Parsons [MSFT] > jared***@online.microsoft.com > All opinions are my own. All content is provided "AS IS" with no warranties, > and confers no rights. I had the application running as a non-administrator but schtasks still does not return an error code. thank you for help Neil See an article I wrote in August 2004 from http://emoreau.s2i.com/. A
wrapper for the scheduled task is available for download. -- Show quoteHide quoteHTH Éric Moreau, MCSD, Visual Developer - Visual Basic MVP Conseiller Principal / Senior Consultant S2i web inc. (www.s2i.com) http://emoreau.s2i.com/ "Neil" <neil***@gmail.com> wrote in message news:1152178494.649138.192680@b68g2000cwa.googlegroups.com... > Hi, > I am having problems in trying to create a scheduled task from within > in application that carries out a health check on a client. I am using > VS 2005. > > When the program runs it flashes a command prompt but does nothing. > > Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create > /tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00 > /ru ""System""") > System.Diagnostics.Process.Start(task) > > Any help will be gratefully received > Neil. > Hi Éric,
this is just what I was looking for, thank you very much. Neil Eric Moreau wrote: Show quoteHide quote > See an article I wrote in August 2004 from http://emoreau.s2i.com/. A > wrapper for the scheduled task is available for download. > > -- > > > HTH > > Éric Moreau, MCSD, Visual Developer - Visual Basic MVP > Conseiller Principal / Senior Consultant > S2i web inc. (www.s2i.com) > http://emoreau.s2i.com/ > > "Neil" <neil***@gmail.com> wrote in message > news:1152178494.649138.192680@b68g2000cwa.googlegroups.com... > > Hi, > > I am having problems in trying to create a scheduled task from within > > in application that carries out a health check on a client. I am using > > VS 2005. > > > > When the program runs it flashes a command prompt but does nothing. > > > > Dim task As New System.Diagnostics.ProcessStartInfo("schtasks /create > > /tn ""Test2"" /tr C:\WINDOWS\system32\calc.exe /sc daily /st 15:14:00 > > /ru ""System""") > > System.Diagnostics.Process.Start(task) > > > > Any help will be gratefully received > > Neil. > >
Valid file name
timer control TreeView control checked based on if records exist CreateInstance and late binding what is best practice to populate large combobox? EM_CHARFROMPOS with RichTextBox Validating Data Using a Error Provider DBNull problem Data binding to an object Somebody please help - Request for the permission of type 'System.Web.AspNetHostingPermission' [...] |
|||||||||||||||||||||||