In the following tutorial explain you to create more directory using DOS command through batch files (.bat), you can create 100 of folder (directory) in double click.
Steps:
1) First you need to set echo off for hide the parent directory.
2) Pause command is used to pause the execution temporary.
3) Set statement is used to assign a value to variable (eg: set a=1)
4) If statement is used to check the condition and continue the execution, else then execute from the next line (eg: if %a% LSS 31 md %a%)
Conditions are check using the following method
The code is
Screenshots:-
Steps:
1) First you need to set echo off for hide the parent directory.
2) Pause command is used to pause the execution temporary.
3) Set statement is used to assign a value to variable (eg: set a=1)
4) If statement is used to check the condition and continue the execution, else then execute from the next line (eg: if %a% LSS 31 md %a%)
Conditions are check using the following method
EQU : Equal
NEQ : Not equal
LSS : Less than <
LEQ : Less than or Equal <=
GTR : Greater than >
GEQ : Greater than or equal >=
This 3 digit syntax is necessary because the > and <
symbols are recognized as redirection operators
5) Goto is used to transfer the execution to another label.NEQ : Not equal
LSS : Less than <
LEQ : Less than or Equal <=
GTR : Greater than >
GEQ : Greater than or equal >=
This 3 digit syntax is necessary because the > and <
symbols are recognized as redirection operators
The code is
echo off
pause
set a=1;
set b=30;
echo %b%
:Rept
if %a% LSS 31 md %a%
set /a a+=1
if %a% LSS 31 goto Rept
cls
set /a a-=1
echo %a% Directory Created Successfully
pause
pause
set a=1;
set b=30;
echo %b%
:Rept
if %a% LSS 31 md %a%
set /a a+=1
if %a% LSS 31 goto Rept
cls
set /a a-=1
echo %a% Directory Created Successfully
pause
Screenshots:-
0 comments:
Post a Comment