File distribution

  • Thread starter Thread starter Cody
  • Start date Start date
C

Cody

Hello freinds:

Is there any way to copy a file to c:\windows\system32 folder on all the
client machines (windows XP sp2) in a Active Directory environment via group
policy or by any other means?

Thanks.
 
Cody said:
Hello freinds:

Is there any way to copy a file to c:\windows\system32 folder on all the
client machines (windows XP sp2) in a Active Directory environment via group
policy or by any other means?

Thanks.

You could do it with your logon script.
 
Following on from this you may need to use a system startup script running
as "local system" to put the file into the System32 directory depending on
the security of your machines.

Dave Britt
 
Peagasus and Dave, thank you very much. I am not a scripting guy, any
sample system script would be helpful.
Thanks again.
 
Cody,

Have a look at the script center some time or do a search for Scriptomatic
and start down the scripting road.

This is a script (Yes this simple) that will copy all of the files for a
particular server and share accross to the machine. You will need to run
this as a startup script to overcome the security for the System32 folder.
If the file already exists on the local machine then just change the script
to copy the loacl file into the System 32 folder, otherwise the machine will
need access to the network share and NTFS read permissions on the files
which should be covered by giving read access to "Domain Computers" group.

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\ServerName\Share\*.*" , "c:\windows\system32" ,
OverwriteExisting

Dave Britt
Blog: http://davebritt.blogspot.com
 
Cody,

Quick follow on:

The script on the last post should be on two lines, when I have viewed it
the newsreader has made it on three. Please ensure one complete line which
starts with "setobjFSO = " and then the second line starts
"objFSO.COPYFile". Save this as a .vbs once you have change the server an
share name.

Dave Britt
 
Something like this would do the trick:

@echo off
xcopy /d /y \\YourServer\SomeShare %SystemRoot%\System32
 
Hi Dave, one last question, I used the script below. It worked fine the
first time, if I restart the machine I am getting an error message "file
already exist". Any ideas?

Thanks
 
Instead of:

objFSO.CopyFile "\\ServerName\Share\*.*" , "c:\windows\system32", OverwriteExisting

use:

objFSO.CopyFile "\\ServerName\Share\*.*" , "c:\windows\system32", TRUE

OverwriteExisting is considered a variable by the Script engine, and unless its defined is considered to be 0 (zero). TRUE is an internal Constant and is equal to 1.
 
Thanks Doug, your solution worked like a charm.


Instead of:

objFSO.CopyFile "\\ServerName\Share\*.*" , "c:\windows\system32",
OverwriteExisting

use:

objFSO.CopyFile "\\ServerName\Share\*.*" , "c:\windows\system32", TRUE

OverwriteExisting is considered a variable by the Script engine, and unless
its defined is considered to be 0 (zero). TRUE is an internal Constant and
is equal to 1.
--
Doug Knox, MS-MVP Windows Media Center\Windows Powered Smart
Display\Security
Win 95/98/Me/XP Tweaks and Fixes
http://www.dougknox.com
 
Back
Top