Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

How do you do....it?

How do you do it forum sponsored by
How do you do it Sponsored by Citnexus

Do you know how to do it? Do you want to let other people know? Post them here. We'll move them once we get a Wiki setup.

Go Back   EduGeek.net Forums > Technical > How do you do....it?
Reply
 
LinkBack Thread Tools Search Thread Language
Sponsored Links
Old 19-08-2008, 11:56 PM   #1
 
damien.deakes's Avatar
 
Join Date: Sep 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 damien.deakes is an unknown quantity at this point
Exclamation Overwrite file on mass.

How would i go about overwriting a file on all the machines on our RM network easily.

There's a txt.ini file we have in c:/windows/sytem32 folder to help a program run, however we have changed some values in it.

Ad i certainly don't want to manually go round overwriting the file on a few hundred machines.
  Reply With Quote
Old 20-08-2008, 12:06 AM   #2
 
FN-GM's Avatar
 
Join Date: Jun 2007
Location: Rochdale, Lancashire
Posts: 4,811
uk
Thanks: 156
Thanked 156 Times in 150 Posts
Rep Power: 37 FN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to behold
Send a message via Skype™ to FN-GM
Default

I would use a startup script. This VBS code will check a master copy of the .txt file on the server against the local one. If the one on the server is more upto date it will update the client one.

Code:
Set objFSO = CreateObject ("Scripting.FileSystemObject")

on error resume next
	sourcefile1 = "c:\file.txt"
	sourcefile2 = "\\server\NETLOGON\bin\files.txt"

	Set objFile = objFSO.GetFile(sourcefile1)
	strFile1 = objFile.DateLastModified
	Set objFile = objFSO.GetFile(sourcefile2)
	strFile2 = objFile.DateLastModified

	If strFile1 <> strFile2 Then 
	objFSO.CopyFile "\\server\NETLOGON\bin\file.txt", "C:\"
	End IF
wscript.quit
The good thing about server 2008 with this type of thing you don't have to mess around with scripts.

edit: you will need to put some variables in there as well, i will see what i can find.

Last edited by FN-GM; 21-08-2008 at 11:31 AM..
  Reply With Quote
Old 21-08-2008, 12:43 AM   #3
 
damien.deakes's Avatar
 
Join Date: Sep 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 damien.deakes is an unknown quantity at this point
Default

and use that as a start up script... is there a basic guide how to do this? as im pretty new to this.
  Reply With Quote
Old 21-08-2008, 11:34 AM   #4
 
FN-GM's Avatar
 
Join Date: Jun 2007
Location: Rochdale, Lancashire
Posts: 4,811
uk
Thanks: 156
Thanked 156 Times in 150 Posts
Rep Power: 37 FN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to behold
Send a message via Skype™ to FN-GM
Default

Hi there

If you copy and paste this code into a notepad and change the path of the original file on the server and the destination. Once you have done that save the file in your netlogon file but save it as a VBS file. for example copyfile.vbs

After that add the script to start-up scripts in group policy.

Code:
Set objFSO = CreateObject ("Scripting.FileSystemObject")

on error resume next
	sourcefile1 = "c:\file.txt"
	sourcefile2 = "\\server\NETLOGON\bin\file.txt"

	Set objFile = objFSO.GetFile(sourcefile1)
	strFile1 = objFile.DateLastModified
	Set objFile = objFSO.GetFile(sourcefile2)
	strFile2 = objFile.DateLastModified

	If strFile1 <> strFile2 Then 
	objFSO.CopyFile "\\server\NETLOGON\bin\file.txt", "C:\"
	End IF
wscript.quit
Let me know how you get on.
  Reply With Quote
Old 21-08-2008, 11:43 AM   #5
 
Michael's Avatar
 
Join Date: Dec 2005
Location: Birmingham
Posts: 2,107
uk uk england
Thanks: 27
Thanked 162 Times in 130 Posts
Rep Power: 38 Michael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to behold
Default

Alternatively you could use xcopy:

Code:
@echo off
xcopy "\\servername\sharename\txt.ini c:\windows\system32\" /y
Again put this in a startup script.
  Reply With Quote
Old 21-08-2008, 12:55 PM   #6
 
damien.deakes's Avatar
 
Join Date: Sep 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 damien.deakes is an unknown quantity at this point
Default

i get an invalid charcater line 1 char 1, after running the xcopy.

no errors on the other but it just didnt copy the file across.
  Reply With Quote
Old 21-08-2008, 12:58 PM   #7
 
kmount's Avatar
 
Join Date: Feb 2007
Location: Northamptonshire
Posts: 1,378
uk
Thanks: 51
Thanked 105 Times in 102 Posts
Rep Power: 25 kmount is a name known to allkmount is a name known to allkmount is a name known to allkmount is a name known to allkmount is a name known to allkmount is a name known to all
Default

If you're on CC3, you could use a package to deploy the file, which may be a bit overkill it certainly allows you version control should you make changes later.
  Reply With Quote
Old 21-08-2008, 12:58 PM   #8
 
FN-GM's Avatar
 
Join Date: Jun 2007
Location: Rochdale, Lancashire
Posts: 4,811
uk
Thanks: 156
Thanked 156 Times in 150 Posts
Rep Power: 37 FN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to beholdFN-GM is a splendid one to behold
Send a message via Skype™ to FN-GM
Default

can we see a copy of your VBS script please?

for xcopy you may have to put quotations around the path if there is a space in the location.
  Reply With Quote
Old 21-08-2008, 01:35 PM   #9
 
Michael's Avatar
 
Join Date: Dec 2005
Location: Birmingham
Posts: 2,107
uk uk england
Thanks: 27
Thanked 162 Times in 130 Posts
Rep Power: 38 Michael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to beholdMichael is a splendid one to behold
Default

Sorry my bad, it should be:

Code:
@echo off
xcopy "\\servername\sharename\txt.ini" "c:\windows\system32\" /y
  Reply With Quote
Reply

Register now for FREE and post messages!


Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Birthday:      
Image Verification
  I agree to forum rules 

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change NT Backups from Append to Overwrite? Kyle Windows 1 04-06-2008 11:03 AM
En-mass uninstall. boomam Windows 31 04-03-2008 10:51 AM
Mass Logon FN-GM Network and Classroom Management 28 18-08-2007 07:45 PM
Backup to Hard Drive. Automatic overwrite of old backup. eean Windows 9 01-08-2006 10:25 AM
Script to copy a shortcut to all users and overwrite an exis tosca925 Scripts 12 21-11-2005 10:49 PM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 11:28 AM.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright EduGeek.net