Thanks to all for your help so far. I'm still having issues, I can't copy files to this path "%appdata%\Hewlett-Packard\HP\C1\Configuration\" because the location doesn't exist on client machines. Using filesys.CopyFile it doesn't create the directory on each client. What would I need to do to create this path for filesys.CopyFile to work for users who are members of "MANAGERS" or have C:\Program Files\Hewlett-Packard\HP\network.exe exist. Here's the script:
dim filesys
Set WSHNetwork = CreateObject("WScript.Network")
Set WshShell = WScript.CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
strfolderpath = objShell.ExpandEnvironmentStrings("%appdata%\Hewlett-Packard\HP\C1\Configuration\")
Set UserObj = GetObject("WinNT://" & WSHNetwork.UserDomain & "/" & WSHNetwork.UserName)
isManager = False
For Each GroupObj In UserObj.Groups
If UCase(GroupObj.Name) = "MANAGERS" Then isManager = True
Next
If isManager Then
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("C:\Program Files\Hewlett-Packard\HP\network.exe") Then
filesys.CopyFile "V:\C1\Configuration\*", strfolderpath
WshShell.Run "regedit /S X:\update.reg", 0, True
End If
Else
WshShell.Run "regedit /S X:\remove.reg", 0, True
End If