1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Task Schedule edit via GPO

Discussion in 'Software' started by ManicD, Apr 24, 2008.

  1. ManicD

    ManicD Byte Poster

    237
    4
    34
    Ok, I am trying to create a batch file to add a scheduled task to computers on the network.

    I'm having issues getting the task scheduler to put the following in the command line box
    "C:\Program Files\Research Machines\Network Management\RM Station Tidy 2\RMSTTaskApp.exe" -v -tD

    I can add it without the " around the file path, but then the task wont run. I'm not entirely sure what teh switches do, i'm looking into that, but i'm assuming i need them.

    I've tried shortening the path so i dont need " marks
    e.g. c:\Progra~1\Resear~1\....

    But i cant seem to get the final filename to run.

    Heres the full command line i'm using, if anyone has any experience with this it would be great

    schtasks /create /RU SYSTEM /SC Daily /TN AshTest3 /TR "C:\Program Files\Re
    search Machines\Network Management\RM Station Tidy 2\RMSTTaskApp.exe" -v -tD /
    ST 13:30:00


    Unless anyone knows a way to edit a current tasks schedule Via a GPO?
     
    Certifications: MCSA, N+, A+(Tech), ECDL
    WIP: 70-294, 70-298
  2. dales

    dales Gigabyte Poster

    1,998
    46
    97
    does the app require admin rights to run as it may be running as a user on the target machine?


    edit: scratch that just re-read it and now assume the gpo is being applied to computers and not users
     
    Certifications: vExpert 2014+2015+2016,VCP-DT,CCE-V, CCE-AD, CCP-AD, CCEE, CCAA XenApp, CCA Netscaler, XenApp 6.5, XenDesktop 5 & Xenserver 6,VCP3+5,VTSP,MCSA MCDST MCP A+ ITIL F
    WIP: Nothing
  3. Stoney

    Stoney Megabyte Poster

    731
    23
    69
    Have you tried using single quotation marks (') instead of double?
     
    Certifications: 25 + 50 metre front crawl
    WIP: MCSA - Exam 70-270
  4. ManicD

    ManicD Byte Poster

    237
    4
    34

    just tried, it didnt work, tried many combinations
     
    Certifications: MCSA, N+, A+(Tech), ECDL
    WIP: 70-294, 70-298
  5. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  6. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    /RU - username to run the task under.
    /SC - schedule
    /TN - Taskname
    /TR - Filepath to execute.

    -v and -tD / dont seem to apply to schtasks. Sounds like you need to be encasing them into the quotations for the filepath, since I would assume they are arguments for that file.

    For more information: enter SCHTASKS /CREATE /? from the command line. you might also want to look at SCHTASKS /CHANGE /? if you are modifying an existing task.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  7. ManicD

    ManicD Byte Poster

    237
    4
    34
    If i encase them in teh quotes it wont appear in teh scheduled tasks correctly....in the sceduled tasks box i need it to say

    "filepath\filename.exe" -v -tD

    but if i put the whole thing in quotes in teh schtasks i only get

    filepath\filename.exe -v -tD
     
    Certifications: MCSA, N+, A+(Tech), ECDL
    WIP: 70-294, 70-298
  8. ManicD

    ManicD Byte Poster

    237
    4
    34
    Certifications: MCSA, N+, A+(Tech), ECDL
    WIP: 70-294, 70-298
  9. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    ah my mistake. I thought that arguments for the program stayed in the quotes, but just checked one of my shortcuts and thats rubbish.

    you could always add the filepath into the PATH variable on those machines. That way, you'd just need to call the exe by name.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present

Share This Page

Loading...