M
M
martensit2018-04-04 10:44:24
cmd/bat
martensit, 2018-04-04 10:44:24

What snippet in .bat (cmd) to find in the file.db directory and copy it to another folder?

You need to find file.db in the d:\aaa directory with a batch file, be sure to search in subfolders. and copy it to d:\eee

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2018-04-04
@martensit

You can search like this:

for /f "tokens=* delims=" %%a in ('dir /b /s d:\aaa\file.db') do (
   echo.%%a
)

On account copy: how do you plan to copy if more than one file is found? In the simplest case, the files will overwrite each other and only the last one found will remain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question