Re: Need help please!
- From: "James Whitlow" <jwhitlow.60372693@xxxxxxxxxxxxx>
- Date: Fri, 8 Feb 2008 08:01:55 -0600
I am trying to get the currently logged in user. As it stand now
there is a folder on the netwrok that holds all of the .PST files.
Each user has a folder under the root of PST that is their user name
and there files are inside of that folder. I want to move the
contents of the folder to H:\pst. I can creat the folder on H fine,
but when the script goes to copy the contents of the users folder I am
gettign a "Exception: Path not found " error. I made a mistake in
the script I posted. I am looking for the username not userprofile.
I am trying to learn as I go and any help is greatly appreciated.
Daryl,
You can just change 'userprofile' to 'username'. Also, I think in the
last line of your script, you should be using 'CopyFile' and not
'CopyFolder'. See if the below modifications work for you.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim objFSO, oWS
Dim sUserProfile, sBUPath
Const OverWriteFiles = True
set oWS = CreateObject("Wscript.Shell")
sUserName = oWS.ExpandEnvironmentStrings("%username%")
set objFSO=CreateObject("Scripting.FilesystemObject")
If Not objFSO.FolderExists("H:\pst\") Then
objFSO.createFolder "H:\pst\"
End If
objFSO.copyfile "S:\PST\" & sUserName & "\*.*","H:\PST\"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.
- References:
- Re: Need help please!
- From: Richard Mueller [MVP]
- Re: Need help please!
- Prev by Date: Re: Determine if array is empty
- Next by Date: Handle files with a . (dot) as first char.
- Previous by thread: Re: Need help please!
- Next by thread: Re: Need help please!
- Index(es):
Relevant Pages
|