Link to home
Start Free TrialLog in
Avatar of aceklub97
aceklub97

asked on

%USERPROFILE% back up in VBScript

Greetings,
I am havingin trouble getting the Script to recognize %USERPROFILE%.     I have the following Code, and when it runs It doesn't give me any error, but it doesn't create a Folder and it doesn't copy the files over.   Can someone please take a look at my code and see where I am going wrong?
Set fso     = wscript.createobject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
...
strUserProfile = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
lotusNotes8FolderPath = strUserProfile & "\local settings\application data\lotus\notes\"
...
fso.copyfolder lotusNotes8FolderPath, folder.path & "\Notes8ProfileData", True

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aceklub97
aceklub97

ASKER

Thanks for the troubleshooting help.  When i used the msgboxes, I realized that I had the variable as: lotusNotes8FolderPath = strUserProfile & "\local settings\application data\lotus\notes\"
instead of
lotusNotes8FolderPath = strUserProfile & "\local settings\application data\lotus\notes"
the first one would have been good for fso.copyfile, but I was using fso.copyfolder.   After that changes it works correctly.
Happy to help - thanx for the grade! :^)