Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Scheduled Task Copy Script

Posted on 2004-10-29
8
Medium Priority
?
262 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
Comment
Question by:CMILLER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 6

Expert Comment

by:kapes
ID: 12448452
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
ID: 12448873
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:
kapes earned 2000 total points
ID: 12453485
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

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


0
 
LVL 6

Expert Comment

by:kapes
ID: 12470737
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
ID: 12470765
* 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
ID: 12476143
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
ID: 12482614
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Screencast - Getting to Know the Pipeline
Suggested Courses

610 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