S
S
Smenov2018-11-07 21:07:40
Command line
Smenov, 2018-11-07 21:07:40

Is it possible to implement this with Windows Shell variables?

Colleagues, I categorically welcome!
I know Windows Shell at a very school level. You need to complete one task. I want to know if this can be done with a set of commands.
Launching the *.cmd file
1. The user enters a variable, 6 digits - <123456>
2. Searches for a file in the specified path - bukva<123456>.txt
3. If the file is not in this folder, then searches in the second folder, along a different path .
4. If found, then copies these files to the USB flash drive.
Can the command line pull this, or do I need to write a program?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2018-11-07
@foxytrail

help FOR
Папка 1 - d:\111
FILE_144004_FILE.txt
FILE_144004_FILE_2.txt
Папка 2 - d:\222
FILE_145005_FILE.txt
FILE_145005_FILE_2.txt
Записать нужно на флешку, диск f:\

SET /p VAL="Введите цифры: "
FOR %%A IN ( d:\111\FILE_%VAL%_FILE*.txt ) DO COPY %%A f:\
SET /p VAL="Введите цифры: "
FOR %%A IN ( d:\222\FILE_%VAL%_FILE*.txt ) DO COPY %%A f:\

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question