Answer the question
In order to leave comments, you need to log in
Need help writing a batch file using the set command?
In the Doki folder, for example, there are folders: 1,2,3 they contain different files, the exact names are unknown, so I decided to make such a command in a bat file that will display all the folders that are in the Doki folder with the dir command, creating set parameters with folder names
for / f "tokens=*" %%1 in ('dir /bz:\Doki') DO set G1=%%1
get
set G1="1"
set G1="2"
set G1="3"
how to make it do each folder separately set parameter
set G1="1"
set G2="2"
set G3="3"
Answer the question
In order to leave comments, you need to log in
Keep a counter of sets and add its value to the variable name. Schematically like this:
setlocal enabledelayedexpansion
set "count=0"
for /f "tokens=*" %%1 in ('dir /b z:\Doki') DO (
set /a "count=!count!+1"
set "G!count!=%%1
)
set /?
for /?
setlocal /?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question