Command Prompt and Task Scheduler

js09130 Posted messages 45 Status Member -  
dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   -
Hello everyone,
1st question:
from the task scheduler, is it possible to run a batch file in the command prompt but as an administrator?

2nd question:
In the command prompt (administrator), the command "TAKEOWN" can generate errors. Is it possible to capture the list of these errors (and their numbers) in a file called ERREURS.TXT?

Thank you for your responses

Configuration: Windows / Firefox 46.0

--
I'm not the best, I'm not the greatest... but I'm here!

1 answer

  1. Anonymous user
     
    Good evening.

    Yes, we can.

    First, open the Task Scheduler: WIN+R (run menu) > type Taskschd.msc > Enter.

    Once the Task Scheduler is open: Action > Create Task


    =============

    In General:
    - Specify a name (whatever you want - batch for example)
    - Specify a description
    - Check the box to Run with highest privileges

    Image for General:


    In Triggers:
    - Click on New and set the trigger as you wish.

    Image for Triggers:

    In Actions:
    - Click on New: This is the exact moment you need to enter your batch file.
    - Action: Start a program
    - Program/script: your batch file

    Image for Actions:
    You can also see the settings.

    ++
    0
    1. js09130 Posted messages 45 Status Member
       
      Thank you Tonton83 ...
      That's some work!

      NOTHING MORE EXPLICIT THAN THAT!

      Thanks again.
      0
    2. js09130 Posted messages 45 Status Member
       
      An answer for question number 2?

      JS.
      0
    3. dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 659
       
      bonjour
      TAKEOWN 2>>ERRORS.TXT
      0
      1. js09130 > dubcek Posted messages 18627 Registration date   Status Contributor Last intervention  
         
        Thank you for the response.
        The solution that doesn't work in my case because this command is included in a batch file. It produces a file with a single line, that is to say the last error and not the complete list of errors.
        Thank you.
        0
    4. dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 659
       
      and with
      batch-name 2>>ERRORS.TXT
      0