Normal.dot replacement script (vb script)

Question:

Hi,

I am not really familiar with scripting however I am trying to modify the following script. The goal is to replace the normal.dot that is located in C:\Program Files\Microsoft Office\Templates

The script below does more since it looks for the user name, renames the file, etc…

Basically the script has to be simplified so the normal.dot gets copied from the server share to the C:\Program Files\Microsoft Office\Templates location.

No need for the file to be renamed and user to be identified since it is place in C:\Program Files instead of the users profile.

Thanks!

Dim objFSO : Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Dim objNetwork : set objNetwork =  CreateObject(“Wscript.Network”)
Dim objShell : Set objShell = CreateObject(“Wscript.Shell”)

strPath = “C:\Documents and Settings\” & objNetwork.UserName
If objFSO.FileExists (strPath & “\application data\microsoft\templates\normal.dot”) Then
If objFSO.FolderExists(strPath & “\application data\microsoft\templates\old-normal”) = False Then
objFSO.CreateFolder strPath & “\application data\microsoft\templates\old-normal”
End If
objFSO.CopyFile strPath & “\application data\microsoft\templates\normal.dot”, strPath & “\application data\microsoft\templates\old-normal\”
End If
objShell.Run “taskkill /IM winword.exe”,1,true
objFSO.CopyFile “\\server\Shared\Normal.dot”, strPath & “\application data\microsoft\templates\”, True

Solution:

All you should need is:

objShell.Run “taskkill /IM winword.exe”,1,true
objFSO.CopyFile “\\server\Shared\Normal.dot”, “C:\Program Files\Microsoft Office\Templates\”, True

Regards,

Rob.

digg delicious stumbleupon technorati Google live facebook Sphinn Mixx newsvine reddit yahoomyweb
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...