emmathews83 Posted March 10, 2011 Report post Posted March 10, 2011 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, Quote Share this post Link to post Share on other sites More sharing options...
0 Peter van der Woude Posted March 10, 2011 Report post Posted March 10, 2011 From where are you copying? The package or a share? Quote Share this post Link to post Share on other sites More sharing options...
0 emmathews83 Posted March 10, 2011 Report post Posted March 10, 2011 It's running from the distribution point. Quote Share this post Link to post Share on other sites More sharing options...
0 Eswar Koneti Posted March 11, 2011 Report post Posted March 11, 2011 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" Quote Share this post Link to post Share on other sites More sharing options...
0 emmathews83 Posted March 11, 2011 Report post Posted March 11, 2011 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. Quote Share this post Link to post Share on other sites More sharing options...
0 Lucid Posted March 11, 2011 Report post Posted March 11, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
0 emmathews83 Posted March 11, 2011 Report post Posted March 11, 2011 Thanks Lucid I will give this a try and let you know. Quote Share this post Link to post Share on other sites More sharing options...
0 emmathews83 Posted March 16, 2011 Report post Posted March 16, 2011 Lucid it worked great. Thank you very much and for everyone who posted thank you. Quote Share this post Link to post Share on other sites More sharing options...
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