Link to home
Start Free TrialLog in
Avatar of jaya31
jaya31Flag for United States of America

asked on

Script to Copy Word Normal.Dotm File

Hi I am having an issue, I need to create a script to rename (some users have macros don't want to delete)  the existing copy of Word's Normal.dotm file and copy a new one from a network share. The problem is I need the script to copy one normal file to a specific group, then copy a different normal to everyone else in an AD environment.



I tried using a batch file through sccm doesn't work, tried using file copy through GPO and it doesn't work as well. Thanks experts in advance for your help.
Avatar of RobSampson
RobSampson
Flag of Australia image

Hi, as an example,
Here is what I use to copy a newer normal.dotm from a server share.
It checks whether the user template on N drive is older than the server copy, will backup up the user copy, then copy over the new version.

Regards,

Rob.

If objFSO.FileExists("\\server\apps\Template\Normal.dotm.new") = True Then
	If CDate(objFSO.GetFile("\\server\apps\Template\Normal.dotm.new").DateLastModified) > CDate(objFSO.GetFile("N:\Normal.dotm").DateLastModified) Then
		intBkpNum = 1
		While objFSO.FileExists("N:\Normal.dotm_bak" & intBkpNum) = True
			intBkpNum = intBkpNum + 1
		Wend
		objFSO.MoveFile "N:\Normal.dotm", "N:\Normal.dotm_bak" & intBkpNum
		objFSO.CopyFile "\\server\apps\Template\Normal.dotm.new", "N:\Normal.dotm"
	End If
End If

Open in new window

Avatar of jaya31

ASKER

Thank you for you response. This is actually what I am looking for, but I need to do it based on groups in AD\GPO. We have one department that needs  a specific normal while other departments require another. Is there any way to do that
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial