VBS to perform backup of folder in user profile
I'm very new to VBS and I need to create a script that locates if a folder is present under the %userprofile% and if so performs a backup of it just adding a .old in the end of the name. I know how to do this with an active setup, but I was told it is not a good idea to use an active setup for this since we wouldn't be sure the folder was properly backed up.
So I was thinking I could read the users profiles from [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList], get the list of profiles from there and do a while loop checking if the folder exists and if not, perform a backup of it .
I found this script for the first part but I don't really know how to go from there:
Const HKEY_LOCAL_MACHINE = &H80000002
Set objRegistry=GetObject("winmgmts:\\" & strLocalPC & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
For Each objSubkey In arrSubkeys
strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "\" & objSubkey
If you could help me get my theory in a script that would be greatly appreciated :)