File path

G

Guest

Hi not sure if this can be done, but I am trying to right a script to copy a
generic template for everyone in the company to use for their signatures
within outlook.

I have written the following VBS script which does not work unless I
specify the username profile for that pc.

Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\tod\outlook$\signature\Template.htm" , "C:\Documents and
Settings\%username%\Application Data\Microsoft\Signatures\Template.htm",
OverwriteExisting
objFSO.CopyFile "\\tod\outlook$\signature\Template.rtf" , "C:\Documents and
Settings\%username%\Application Data\Microsoft\Signatures\Template.rtf",
OverwriteExisting
objFSO.CopyFile "\\tod\outlook$\signature\Template.txt" , "C:\Documents and
Settings\%username%\Application Data\Microsoft\Signatures\Template.txt",
OverwriteExisting.

Anyone got any ideas how I can get around this
 
R

Ramesh, MS-MVP

Neil,

First, expand the %username% and store it in a variable. Use this script,
add/modify lines accordingly.

-----------------------------------------------------
set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
UserPath = WshShell.ExpandEnvironmentStrings("%Userprofile%")
DestPath = UserPath & "\Application Data\Microsoft\Signatures\"
SourcePath = "\\tod\outlook$\signature\Template.htm"
objFSO.CopyFile SourcePath, DestPath
Set WshShell = Nothing
Set objFSO = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top