i would like to know hot it is possbile to copy a file to all users in windows 7
I have found one on the net but it dont work
Quote
' AUTHOR: Eshwar
' DATE : 12/12/2008
' COMMENT: This script will copy source files/folders to each user profile on the machine
'==========================================================================
'On Error Resume Next
'DECLARE VARIABLES HERE
Dim fso
Dim oFolder1, objFolder, oFolder
Dim path
Dim WSHShell
Dim colFolders
Dim sDocsAndSettings
Dim strComputer
strComputer = "."
Set WSHShell = CreateObject("WScript.Shell")
Set fso = createobject("Scripting.FileSystemObject")
'SPECIFY THE PATH OF THE FOLDER IN WHICH SOURCE FILES RESIDE
Set oFolder1 = fso.GetFolder("c:\MyFolder")
'COPY FILES TO USER PROFILES
sDocsAndSettings = "C:\Users\"
Set colFolders = fso.GetFolder(sDocsAndSettings)
For Each oFolder In colFolders.SubFolders
Select Case LCase(oFolder.Name)
Case "admin", "administrator", "newuser", "all users", "default user.original", "localservice", "networkservice"
'LEAVE THE DEFAULT PROFILES ON THE MACHINE
Case Else
' Check for the path
If fso.FolderExists(sDocsAndSettings & oFolder.Name & "\AppData") Then
'COPY FOLDER TO USER PROFILE
fso.CopyFolder oFolder1, sDocsAndSettings & oFolder.Name & "\AppData\Roaming\IDMComp\UltraEdit" ,True
End If
End Select
Next
Set fso = Nothing
Set WSHShell = Nothing



Help

Back to top









