I have below cmd commands, when I run these in a batch file it doesn't execute as the command prompt terminates. But when I run these one by one manually it executes.
CD /d o:\database\UK
dir *LWRKF03* *NCOM* *DTP* *LLIQ01* *LCOG01* *LCIMS02* *LCLS01* *LOLYM* *LCHUB01* *ISD* *PUKODYS01* *PUKHSSS02* /s /t:c | findstr "%date%">C:\Users\43874210\Desktop\UK\FoundFiles.TXT
for /f "tokens=5 delims= " %i in ('"dir *LWRKF03* *NCOM* *DTP* *LLIQ01* *LCOG01* *LCIMS02* *LCLS01* /s /t:c | findstr "%date%""') do copy "%i" C:\Users\43874210\Desktop\UK
for /f "tokens=5 delims= " %i in ('"dir *LWRKF03* /s /t:c | findstr "%date%""') do copy "%i" X:
for /f "tokens=5 delims= " %i in ('"dir *NCOM* /s /t:c | findstr "%date%""') do copy "%i" W:
for /f "tokens=5 delims= " %i in ('"dir *DTP* /s /t:c | findstr "%date%""') do copy "%i" T:
for /f "tokens=5 delims= " %i in ('"dir *LLIQ01* *LCOG01* *PUKODYS01* *PUKHSSS02* /s /t:c | findstr "%date%""') do copy "%i" Q:
for /f "tokens=5 delims= " %i in ('"dir *LCIMS02* *LCLS01* /s /t:c | findstr "%date%""') do copy "%i" S:
for /f "tokens=5 delims= " %i in ('"dir *LOLYM* /s /t:c | findstr "%date%""') do copy "%i" R:
for /f "tokens=5 delims= " %i in ('"dir *LCHUB01* *ISD* /s /t:c | findstr "%date%""') do copy "%i" H:
%%iinstead of%i(described infor /?)cmd) window and run the batch file by typing its path into it (enclosed in""), so you could see any error messages...