Scheduled Task Copy Script

How do I make a scheduled task and copy it to all my XP Pro networked PC's
CMILLERAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kapesCommented:
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
CMILLERAuthor Commented:
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
kapesCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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


0
kapesCommented:
it is to... remove the Environment Variable "TaskName"... at the end of script,... since we created it for use in script.
0
kapesCommented:
* 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
CMILLERAuthor Commented:
It worked, thanks


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

-Chris
0
kapesCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.