Solved

Hi all., I need a script to update a file on all the machines in our organization.

Posted on 2014-09-15
4
331 Views
Last Modified: 2014-09-15
We have a file which is stored on "%winddir%Appdata/Roaming/Foldername". I need to automate the process of updating this file to almost 300 machines. I hope if I have a script to do this job which then can be deployed via SCCM or GP. Can someone please help me with this.
0
Comment
Question by:Jamsheer Meethal
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
ID: 40323838
If its just a single file and the file is the same across all of the hosts why not just do a simple xcopy?

xcopy \\source \\target
0
 

Author Comment

by:Jamsheer Meethal
ID: 40323847
Hi Joseph, thanks for your prompt response., can I use xcopy to replace the existing file in the same location on the users machine., even a rename to *.old will also do the job. I am sorry, but I am very poor in scripting.  Thanks again.
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 40323874
below should work but i would still test it on a single machine to make sure

rename %winddir%Appdata/Roaming/Foldername/file.existing %winddir%Appdata/Roaming/Foldername/file.old
xcopy  /C \\server\share\file.new %winddir%Appdata/Roaming/Foldername/file.new
0
 

Author Closing Comment

by:Jamsheer Meethal
ID: 40323983
HI, can you please let me krnow if xcopy can be used to remove or rename the existing file on the users machine before copying the new file from my share.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hibernate on windows 10 18 120
noX challenge 17 91
wordappend challenge 8 147
VBSCRIPT string remove all characters to the right after extension 4 53
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

23 Experts available now in Live!

Get 1:1 Help Now