shconsultancy
asked on
script to copy a file from one location to another
I have pst files in user folders that I need to move to another shared area on the same server. I need a vbs/cmd/batch file to run this.
The folder structure is as follows:
\\server1\userarchive\user initials\notes_user initials.pst and I need it to go to \\server1\userdata\user initials\_notes archive
There are a few hundred users that this will need to go through.
There is only one .pst file in each user folder so *.pst will be fine in the script
Please help, very urgent
Steve
The folder structure is as follows:
\\server1\userarchive\user
There are a few hundred users that this will need to go through.
There is only one .pst file in each user folder so *.pst will be fine in the script
Please help, very urgent
Steve
ASKER
Yes that is correct
Hi,
Yes you can use it to copy to network drives
Robocopy is a microsoft tool which many IT adminsitrators use to copy
http://www.ss64.com/nt/robocopy.html
The above link will give you a good start.
Yes you can use it to copy to network drives
Robocopy is a microsoft tool which many IT adminsitrators use to copy
http://www.ss64.com/nt/robocopy.html
The above link will give you a good start.
ASKER
Yes but will Robocopy loop through all of the hundreds of user folders to do what I ask it to?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
copy \\server1\userarchive\%USE RNAME%\not es_user initials.pst \\server1\userdata\%USERNA ME%\_notes archive\
:# is this what you mean?
:# is this what you mean?
One problem with my solution I just noticed is that it copies and you said move. You can change the line that says....
objFSO.CopyFile tempSource, tempDest
to
objFSO.MoveFile tempSource, tempDest
objFSO.CopyFile tempSource, tempDest
to
objFSO.MoveFile tempSource, tempDest
ASKER
Excellent, just what I was looking for. I managed to change the Copy to Move before you sent the message.
Superb service
Steve
Superb service
Steve
you would have:
\\server1\userarchive\abc\
and want it to become
\\server1\userdata\abc\_no
is that right?