Improve ...

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mor.bas
Posts: 66
Joined: 25 Apr 2012 04:28

Improve ...

#1 Post by mor.bas » 29 Aug 2012 10:18

I have this two lines :
cd /D c:\temp
for /f "delims=" %%a in ('dir /b ^| findstr /c:"test"') do copy "%%a" "e:\SXS"
I look for files with name-test to copy to destination.
can I changed it to one line or somthing else I dont want that in the end I will be in this directory (c:\temp)?

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Improve ...

#2 Post by Squashman » 29 Aug 2012 10:50

Code: Select all

Pushd c:\temp
for /f "delims=" %%a in ('dir  /b  ^|  findstr /c:"test"') do copy "%%a" "e:\SXS"
Popd

Post Reply