The article consoleadmin is useful.
Here is the script I used to copy a single file ( java exceptions ) into each local profile.
You would just have to alter the copyfile part for your use and ensure the source file is in same directory as script.
I specifically excluded the script from looking/copying into default profile folders and since i was only targeting locally cached doamin profiles.
On Error Resume Next
Const OverwriteExisting = True
Const strComputer = "."
Const HKLM = &H80000002
Dim StrDocandSettings,strSysDrive, strProfilePath
Dim aryUser
Dim oFSO, objShell, CurrentDir, oReg
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject( "WScript.Shell" )
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strSysDrive=objShell.ExpandEnvironmentStrings("%SystemDrive%")
strProgramFiles=objShell.ExpandEnvironmentStrings("%ProgramFiles%")
strProgramData=objShell.ExpandEnvironmentStrings("%ProgramData%")
CurrentDir = oFSO.GetParentFolderName(Wscript.ScriptFullName)
oReg.GetExpandedStringValue HKLM, "Software\Microsoft\Windows NT\CurrentVersion\ProfileList", "ProfilesDirectory", strProfilePath
If VarType(strProfilePath) = vbNull Then
'wscript.echo "error: registry key not found"
wscript.Quit(1)
End If
'Setting the environment for userprofile
If OSis7or8 Then
Set StrDocandSettings = oFSO.getFolder(strSysDrive & "\users")
'Taking all the folder under "users" or in "documents and settings"
Set aryUser = StrDocandSettings.SubFolders
'Restricting the user
For Each strUserName in aryUser
' Ignore All Users folder, Administrator profile, and system folders
If strUserName.Name <> "All Users" and strUserName.Name <> "Administrator" _
And strUserName.Name <> "LocalService" And strUserName.Name <> "NetworkService" _
And strUserName.Name <> "Default" And strUserName.Name <> "Public" _
And strUserName.Name <> "Default User" And strUserName.Name <> "NetworkService" Then
GeneratePath(strUsername & "\AppData\LocalLow\Sun\Java\Deployment\security")
oFSO.CopyFile CurrentDir & "\exception.sites" , strUsername & "\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites" , True
End If
Next
'XP Operating system
Else
Set StrDocandSettings = oFSO.getFolder(strProfilePath)
'Taking all the folder under "users" or in "documents and settings"
Set aryUser = StrDocandSettings.SubFolders
'Restricting the user
For Each strUserName in aryUser
' Ignore All Users folder, Administrator profile, and system folders
If strUserName.Name <> "All Users" and strUserName.Name <> "Administrator" _
And strUserName.Name <> "LocalService" And strUserName.Name <> "NetworkService" _
And strUserName.Name <> "Default" And strUserName.Name <> "Public" _
And strUserName.Name <> "Default User" And strUserName.Name <> "NetworkService" Then
GeneratePath(strUsername & "\Application Data\Sun\Java\Deployment\security")
oFSO.CopyFile CurrentDir & "\exception.sites" , strUsername & "\Application Data\Sun\Java\Deployment\security\exception.sites" , True
End If
Next
End If
WScript.Quit
Function OSis7or8
Dim WshShell, strVal
Set WshShell = CreateObject("WScript.Shell")
OSis7or8 = False
On Error Resume Next
strVal = WshShell.RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProductName")
Err.Clear
On Error Goto 0
If Instr(LCase(strVal), "windows 7") > 0 Then
OSis7or8 = True
End If
If Instr(LCase(strVal), "windows 8") > 0 Then
OSis7or8 = True
End If
End Function
Function GeneratePath(pFolderPath)
GeneratePath = False
If Not oFSO.FolderExists(pFolderPath) Then
If GeneratePath(oFSO.GetParentFolderName(pFolderPath)) Then
GeneratePath = True
Call oFSO.CreateFolder(pFolderPath)
End If
Else
GeneratePath = True
End If
End Function
Any questions just ask.
Thanks,
Clay