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?
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Happy to help - thanx for the grade! :^)
ASKER
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.