I have to get an updated config file to several users across some distance, and I was wondering if anyone knew of a good automated way to do this, rather than sending them the file and talk them through it, as that would be akin to pulling teeth. Everyone should be on windows 7. Any suggestions would be much appreciated!
2 Answers
Are these machines all in your domain? You could distribute the file via Group Policy Preferences.
Or you could just Robocopy the file. Put it in a script, something like
foreach($_ in Get-Content hosts.txt) { robocopy C:\ \\$_\c$\folder file.cfg }
I need some more details if those options won't do it for you.
-
I have an ini file that I am trying to send to some other computers in the business I work at, and I need to send an update to them all. I have been exploring using a ".bat" file, but the issue is that I have never worked with one, and have no idea what I am doing. We are not all on the same server, so this needs to be something I could do over the internet.– EricJan 21, 2013 at 19:55
-
A batch (.bat) file is just a series of command prompt (DOS-like) commands run in sequence. It can contain logical loops and variables. You could hypothetically just put 50 robocopy statements in the file to run it 50 times on 50 different computers if you wanted to. You'll need network connectivity and permissions to the remote machines. Jan 21, 2013 at 20:04
-
try this in a Command Prompt if you prefer standard windows CMD to Powershell:
for /F %f in (listofhosts.txt) do (copy /Y <path to Updated.INI> \\%f\c$\<updatedINIdirectory on host>)
This assumes that:
1) you have the same account on all hosts (domain admin account)
2) all hosts are on the network
The alternative is to encapsulate the INI into a ZIP file, with the Pathname option selected. Email the ZIP to your users, along with instructions to
1) save the ZIP in their root C:\ directory
2) extract it.
The file will be copied to the appropriate directory automatically.