New
#1
Struggling with CMD - Copy
Hello SF world,
I recently thought I found a fix for my issue on this forum, sadly it did not work
So none the less I'd like to try asking my specific issue.
Summary
I need to copy over 1000 files that are all in PDF from a shared drive that has a few hundred TB of data.
I've been given a list of unique identifiers(all #s) for the ones I need however the files I need contain both a numerical value and 1 or 2 alphabetic ones additionally some may have the hyphen between numbers and letters.
Information
I know the exact root folder path thing is my desired PDFs may be located in 2-3 sub-folders if not more...
(Let's call the shared Drive T: )
Just to get an idea of what mapping i'm dealing with T: will break into many folders which i'm not concerned about that since I know exactly which 1st sub-folder they should be in
Once i'm in my folder I hit a dead end as my desired files may could be in Folder 1,2,3,30,40,50.
I have no way of knowing exactly where they are other than searching one by one... but we all know how time consuming that is.
I've tried a few variations to attempt to locate them;
First from an excel sheet I converted to *.bat
Command Output: Current Folder Path File Name Enter Destination Folder Path Below
COPY "T:\Main\Test1test.pdf" XXXXXX "T:\Main\Test2"
Then I tried my luck with CMD after spending quite sometime on google;
@echo off
set LISTFOLDER=T:\Main\Test1
set FILESPATH=T:\Main\Test1\Filelist
set DESTPATH=T:\Main\Test2
for /f "tokens=*" %%i in ('dir /b ^"%LISTFOLDER%\*.txt^"') do (call :COPY_FILES "%LISTFOLDER%\%%i")
pause
exit
:COPY_FILES
for %%i in (%1) do set DEST=%%~ni
for /f "usebackq delims==" %%i in (%1) do xcopy /qv "%FILESPATH%\%%i" "%DESTPATH%\%DEST%\*"
No luck either. I'm not any good with CMD as I've never learned it (though now I wish I had...)
Desired resolution
I'd like to have someone show me where am going wrong by giving me the proper cmd, I understand that a wildcard value might help but would this be any good for both hyphens and alphabetical values after the numbers most files should not have any spaces but then again I'd rather cover all angles.
Thanks in advance to whoever replies,