New
#1
Batch file to search directory for file type and copy to new location
Hi all,
Not sure if posting in correct area, I would like to have a batch file that can search a directory or drive for file type and copy that file into a new directory renaming the file to reflect what users folder it came out of.
To be a little more specific, I have multiple systems all Windows 10 ver 1909, most likely multiple user profiles on each. My task is to get all the old PST files from these systems copy to a central location then use Azure import to upload and archive into Office 365 users online archive.
I am confident that the first part can be done through Batch file, as most pst files are labelled outlook.pst, I would like it to copy to new location and rename the file to the username of the users profile the pst file came out of, but also if there are multiple outlook.pst for same user it might be wise to append 1,2,3 etc.
E.g.
Old system: New location:
c:\users\Joe.Blogs\outlook files\outlook.pst F:\PSTfiles\Joe.blogs\joe.blogs.pst
c:\users\Jane.Blogs\outlook files\outlook.pst F:\PSTfiles\Jane.blogs\jane.blogs.pst
c:\users\Joe.Blogs\outlook files\office.pst F:\PSTfiles\Joe.blogs\joe.blogs1.pst
c:\users\Joe.Blogs\outlook files\joe.blogs.pst F:\PSTfiles\Joe.blogs\joe.blogs2.pst
c:\users\Joe.Blogs\outlook files\joe.blogsnewprofile.pst F:\PSTfiles\Joe.blogs\joe.blogs3.pst
Ideally, it would be really good to be able to run this batch file and it stores pst to a network location (permissions would be configured to allow this)
I also have a cupboard of drives that I would ideally like to connect to a desktop machine and target the search on that drive.
I hope this makes sense? Can anyone help?
Many thanks
John