Solved

Scheduled Task Copy Script

Posted on 2004-10-29
256 Views
Last Modified: 2007-12-19
How do I make a scheduled task and copy it to all my XP Pro networked PC's
0
Question by:CMILLER
    8 Comments
     
    LVL 6

    Expert Comment

    by:kapes
    I assume you have admin rights on all these machines...

    Then download dameware utilities... (EVAL COPY)

    It allows to schedule same batch job on multiple computers...

    0
     

    Author Comment

    by:CMILLER
    Yes I have admin rights.

    I cant use Dameware on the network

    I found this

    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx
    0
     
    LVL 6

    Accepted Solution

    by:
    Or try this...

    Create a schedule task on one of the XP machine...
    and then copy it from " C:\WINDOWS\Tasks" folder to Destination Machine's same folder..

    Here I am assuming that.. the command component you are scheduling is available on all the destination machines...

    Using this kind of batch file...

    First create a list of machines on which you want to schedule a task in a simple text file.. say   c:\Computers.txt

    Make sure you are logged in with Admin Rights for all the destination machines, then run this script from source machine

    -----------------------------------------------------
    @echo off
    Set  TaskName="MyTask.job"

    For /F "Tokens=1*" %%A in (c:\computers.txt) do (
    echo.
    Echo Copying Task %TaskName% to %%A ...
    copy c:\windows\tasks\%TaskName%  \\%%A\admin$\Tasks\%TaskName% /y /v /z
    echo.
    )
    set TaskName=
    -----------------------------------------------------

    0
     

    Author Comment

    by:CMILLER
    Why is the last "set TaskName=" blank, do I need to put the name there ?


    0
     
    LVL 6

    Expert Comment

    by:kapes
    it is to... remove the Environment Variable "TaskName"... at the end of script,... since we created it for use in script.
    0
     
    LVL 6

    Expert Comment

    by:kapes
    * Make sure computers.txt has only one computername on each line

    * you have put the Task name in the first line where it says

    set TaskName="myTask.job"  

    replace "mytask.job" with the actual job name...
    also if job name contains spaces... then we have to enclose the source and dest paths in double-quotes (")

    so, change the following line

    copy c:\windows\tasks\%TaskName%  \\%%A\admin$\Tasks\%TaskName% /y /v /z

    to

    copy "c:\windows\tasks\%TaskName%"   "\\%%A\admin$\Tasks\%TaskName%"  /y /v /z
    0
     

    Author Comment

    by:CMILLER
    It worked, thanks


    Do you know where to point me in the right direction
    to learn scripting like this?

    -Chris
    0
     
    LVL 6

    Expert Comment

    by:kapes
    sure...

    You can go to microsoft.com and search for Technet Script Center... it provides lots of admin scripts...
    Also Download the documentation of Windows Scripting Host... from microsoft site..

    It should get you started...

    Also, this is a good site for scripting...

    http://www.robvanderwoude.com/
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    Suggested Solutions

    Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
    Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
    In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now