Re: Need help please!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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\"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


.



Relevant Pages

  • Re: POP3 email problems
    ... I will take another look for the .pst files. ... OE then have to import the dbxfiles in the previous identities folder) ... Unfortunately they were not backing up their workstations or the server. ... updates were not installing and there was other ...
    (microsoft.public.windows.server.sbs)
  • Re: Transfer PST File to New computer
    ... Then I copied the messages and contacts from the newly opened folder ... Can I delete the "old" profile? ... Ken Hudson ... These two pst files, Outlook.pst and Archive.pst, are in my current ...
    (microsoft.public.outlook.installation)
  • Re: Transfer PST File to New computer
    ... Ken Hudson ... personal folder at the bottom of the list. ... Can I delete the "old" profile? ... How many PST files are in your current profile (make sure you ...
    (microsoft.public.outlook.installation)
  • Re: Synchronization questions
    ... I used to have a folder I used all the time so I just drug a short cut to ... > I believe the My Docs sync settings are controlled on the server - go into ... > Server mailboxes, and the PSTs gotten rid of. ... >> to backup up the users important files we have moved their *.pst files to ...
    (microsoft.public.windows.server.sbs)
  • Re: Problems seeing personal folders
    ... the .PST files and still cannot find the missing items, ... another folder within the same file) by mistake. ... If the Find does not turn up the missing items, close Outlook and run the ... >> Jocelyn Fiorello ...
    (microsoft.public.outlook.general)