Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6049899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:37:42+00:00 2026-05-23T07:37:42+00:00

I am trying to integrate a scheduled job statement into Process.Start Process.Start(schtasks.exe, \ +

  • 0

I am trying to integrate a scheduled job statement into Process.Start

Process.Start("schtasks.exe", "\"" + textBox1.Text + "\"");

How would it be possible to add the parameters below into the Process.Start statement above?

schtasks /Create /SC DAILY /TN TestJob /TR "C:\Program Files\test\test.exe 'C:\'"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:37:43+00:00Added an answer on May 23, 2026 at 7:37 am

    You can interact with the windows task manager directly using TaskScheduler. It will give you access to a whole range of properties of the task and under what conditions it will be fired. It, of course, require more code, but it gives you all the control that you need in a managaged manner.

    This is a piece of code that im using myself and it is working well (ive cut away some of my business logic so not all arguments will compile/make sense). It will basically create a task that will fire one minute from Now:

        TaskScheduler.TaskScheduler scheduler = new TaskScheduler.TaskScheduler();
        scheduler.Connect(null, null, null, null); //run as current user.
    
        ITaskDefinition taskDef = scheduler.NewTask(0);
        taskDef.RegistrationInfo.Author = "Me me me";
        taskDef.RegistrationInfo.Description = "My description";
        taskDef.Settings.ExecutionTimeLimit = "PT10M"; // 10 minutes
        taskDef.Settings.DisallowStartIfOnBatteries = false;
        taskDef.Settings.StopIfGoingOnBatteries = false;
        taskDef.Settings.WakeToRun = true;
    
        ITimeTrigger trigger = (ITimeTrigger)taskDef.Triggers.Create(_TASK_TRIGGER_TYPE2.TASK_TRIGGER_TIME);
    
        DateTime nextRun = DateTime.Now.AddMinutes(1); // one minute from now
        trigger.StartBoundary = nextRun.ToString("s", System.Globalization.CultureInfo.InvariantCulture);
    
        IExecAction action = (IExecAction)taskDef.Actions.Create(_TASK_ACTION_TYPE.TASK_ACTION_EXEC);
        action.Id = "exe name";
        action.Path = "path to exe";
        action.WorkingDirectory = "working dir";
        action.Arguments = "app arguments";  /// <-- here you put your arguments..
    
        ITaskFolder root = scheduler.GetFolder("\\");
    
        IRegisteredTask regTask = root.RegisterTaskDefinition(
            "My task name",
            taskDef,
            (int)_TASK_CREATION.TASK_CREATE_OR_UPDATE,
            null, // user
            null, // password
            _TASK_LOGON_TYPE.TASK_LOGON_INTERACTIVE_TOKEN, //User must already be logged on. The task will be run only in an existing interactive session.
            "" //SDDL
            );
    

    More explaination and code samples can be found here: Calling the Task Scheduler in Windows Vista (and Windows Server 2008) from managed code

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to integrate Yahoo Media Player into my own website, I want to
I'm trying to integrate a public message board service into an existing web site.
I am trying to integrate the function into a map where you can enter
I am trying to integrate a Hibernate application into a proprietary framework. My problem
I'm trying to integrate quartz scheduler into a struts2 web app. Just wondering where
I'm trying integrate spring with hibernate but catch exception on project start. Caused by:
I am trying to integrate NHibernate.Search into a multi-lingual website. Now, this website contains
I'm trying to integrate a Facebook send button into my site using Facebook app.
I am trying to integrate OpenFeint 2.12.5 into my app. I already read this
I'm trying to integrate a legacy database in Django. I'm running into problems with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.