I
I
ic3y2021-10-15 11:23:58
cmd/bat
ic3y, 2021-10-15 11:23:58

How to inject cmd search result into variable?

I have a task to enter the search result
dir steam.exe /sinto a variable, in order to then move the file using move to this directory from the variable
Please, help !!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2021-10-15
@res2001

Correct command: dir /s steam.exe
Something like this would be:

for "tokens=* delims=" %%a in ('dir /s  steam.exe') do (
  move "%%~a" "путь куда перемещаем файл"
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question