Help needed with VBS to copy local folders to shared folder

Hi,

I would like to run a script to copy these two folders from local workstations to the shared folder for that particular user.

I have the following code but it does not work.

Could someone give me a hand?

Thank you.

-------------------
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
Set fso = CreateObject("Scripting.Filesystemobject")
set wshShell = CreateObject("wscript.shell")


'--------------------------

'--------------------------
'DETERMINE THE GROUPS THE USER IS IN.
'NOTE THAT IF THE PERSON IS IN ONE GROUP, THE JOIN COMMAND WILL ERROR.
'THIS IS WHY ISARRAY IS NECESSARY.

If InStr(strGroups, LCase(";YourUserGroupName;")) > 0 Then
      ' Move the files
End If

'---------------------------
'GET CURRENT USERS LOGON NAME
Set wshShell = CreateObject("WScript.Shell")
Set objFolder = objFSO.GetFolder
strUser = wshShell.ExpandEnvironmentStrings("%USERNAME%")
'msgbox strUser

'THIS SUBROUTINE COPIES THE USERs NME PROFILE TO A HIDDEN SHARE

Set nFSO = CreateObject("Scripting.FileSystemObject")

Dest="\\ss1\nmeprofiles$\"+StrUser+"\"

If nFSO.FolderExists(Dest) Then
  '
else
  nFSO.CreateFolder(Dest)

end if

nFSO.CopyFolder "C:\Program Files\Monarch\Reports, Dest
nFSO.CopyFolder "C:\Program Files\Monarch\Models, Dest
llaravaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

piattndCommented:
There is an overwrite statement that you may need.  Use it with caution, as it may overwrite files/folders you didn't intent.

nFSO.CopyFolder "C:\Program Files\Monarch\Reports", Dest, true
nFSO.CopyFolder "C:\Program Files\Monarch\Models", Dest, true
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
llaravaAuthor Commented:
The script does not error out. The user is created as folder in the destination but none of the 2 folders are copied over.

Any help?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.