I need to find all *.PST file on my "C" drive, and copy all instance to a new folder on C:\
How to do this in dos-batch with keep the original structure? I don't want to override the second instance the first one..
for /f "delims=" %%i in ('dir /s /b /a-d *.PST') do copy /b "%%~i" "C:\backuppst"
As you suggested I use Xcopy:
Xcopy c:*.pst c:\backuppst /i/h/s/y /Exclude:my.txt
In my.txt I have: C:\backuppst
But I got "cannot preform cycling copy"
This should work for you if there are no PST files under c:\backuppst to begin with.
@echo off
for /f "delims=" %%i in ('dir /s /b /a-d \*.PST') do xcopy "%%~i" "c:\backuppst%%~pi"
pause