Jump to content


  • 0
emmathews83

How to copy a .POTX file to a users profile using SMS 2003

Question

Hello,

 

I am trying to copy a 2007 PowerPoint template (.potx file) to the following location on a computer using SMS 2003.

 

Location: C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\

 

I am using the below batch file.

 

xcopy *.potx "C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\"

 

It says it successful but never copies the file.

 

Any one know of a better way.

 

Thank you,

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hello,

I am trying to copy a 2007 PowerPoint template (.potx file) to the following location on a computer using SMS 2003.

Location: C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\

I am using the below batch file.

xcopy *.potx "C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\"

It says it successful but never copies the file.

Any one know of a better way.

 

Thank you,

 

try this VBscript to copy a file:

 

 

strComputer = InputBox ("Enter Machine Name") 
strFileName = "C:\FileName.Txt" 
Const OverwriteExisting = True 
Set objFSO = CreateObject("Scripting.FileSystemObject") 
objFSO.CopyFile strFileName, "\\" & strComputer & "\C$\" 
MsgBox "Done"


 

Share this post


Link to post
Share on other sites

  • 0

Eswar,

 

I see the part about Machine Name, but this is going to be pushed out to over 1000 computers. Is there a way to to do it to all of them at once?

 

Also, is it possible to put it in this location:

 

C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\

 

 

Thank you for your help.

Share this post


Link to post
Share on other sites

  • 0

I think you'd need to do something more like this then:

 

Option Explicit

Dim objWshShell, objFSO, strScriptFileDirectory

Dim strAllUsersDesktopPath, strUserProfilesMainFolder

Dim UserPaths, Subfolder, strAppDataFolder

 

Set objWshShell = WScript.CreateObject("WScript.Shell")

Set objFSO = CreateObject("Scripting.FileSystemObject")

strScriptFileDirectory = objFSO.GetParentFolderName(wscript.ScriptFullName)

 

 

strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")

' Attempts to configure Windows 2000/XP paths.

strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))

If strUserProfilesMainFolder = "" Then

' Attempts to configure Windows Vista/7 paths.

strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))

End If

 

Set UserPaths = objFSO.GetFolder(strUserProfilesMainFolder).Subfolders

For Each Subfolder in UserPaths

If Subfolder = (strUserProfilesMainFolder & "LocalService") Then

' Does nothing.

Else

If Subfolder = (strUserProfilesMainFolder & "NetworkService") Then

' Does nothing.

Else

If Subfolder = (strUserProfilesMainFolder & "Public") Then

' Does nothing.

Else

If objFSO.FolderExists (Subfolder & "\Application Data") Then

strAppDataFolder = Subfolder & "\Application Data"

Else

strAppDataFolder = Subfolder & "\AppData\LocalLow"

End If

 

If Not objFSO.FolderExists (strAppDataFolder & "\Microsoft") Then

objFSO.CreateFolder (strAppDataFolder & "\Microsoft")

End If

If Not objFSO.FolderExists (strAppDataFolder & "\Microsoft\Templates") Then

objFSO.CreateFolder (strAppDataFolder & "\Microsoft\Templates")

End If

If objFSO.FileExists (strScriptFileDirectory & "\xxxx.potx") Then

objFSO.CopyFile (strScriptFileDirectory & "\xxxx.potx"), (strAppDataFolder & "\Microsoft\Templates\xxxx.potx"), True

End If

End If

End If

End If

Next

 

Wscript.Quit

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.