Answer the question
In order to leave comments, you need to log in
Creating folders for each day with .bat?
Sorry, new to .bat. There was a need to create 30 folders with the name "XX.YY", where X is the date, Y is the month. In this case, the first folder is the first day of the month (01.01), the second folder is the next day (01.02). Also in each of these folders there should be 2 more folders: "wb" and "zaliv". I do not quite understand how to implement this, I hope for your help.
I would be extremely grateful for your dedicated time to solve this problem.
Answer the question
In order to leave comments, you need to log in
Simplified, you can do this:
@echo off
for /l %%a in (1,1,12) do for /l %%b in (1,1,31) do ( md %%a.%%b\wb 2>nul & md %%a.%%b\zaliv 2>nul)
for /l
, but the usual
one. Of course, you can write a function that expands the string to a given length with the desired character, but too lazy to mess around. You can google for "cmd padding string", on the gray forum and ru-board there are sensible branches on batch files.
You can set the exact number of days in a month using a predefined list of days for each month, something like this:for %%a in (01 02 03 04 05 ...) do
setlocal enabledelayedexpansion
set "mday1=01 02 03 04 05 ..." :: в mday1 - 1 - это номер месяца (январь)
set "mday2=01 02 03 04 05 ..."
:: и так далее до mday12
...
for %%b in (!mday%%a!) do ...
for /l %%b in (1,1,!mday%%a!) do
@echo off
setlocal enabledelayedexpansion
for /l %%I in (1,1,30) do (
set S=0%%I
set S=!S:~-2!.01
mkdir !S!\wb
mkdir !S!\zaliv
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question