dos of the for loop (small "virus")

demand:

1, test2019 automatically create a folder in D drive;

2, automatically test2019 below to create 100 files, and write "This is the contents of the file a few!"

3, the automatic operation of the window opening 100 CMD (kept open)

Note:

1, this code only do personal study, and friends joke. . . Do not malicious use!

2, for the number of cycles in the loop, please carefully set. Too many cycles, the computer will get stuck! Really stuck!

3, if the computer has antivirus software installed, prevents open the folder!

code show as below:

@echo off% to close echo, just do not show this piece of code% in the CMD window 
cd / d D: /% current directory to D: /%
 IF not exist dostest2019 md test2019% judge dostest2019 folder does not exist is created the folder% 
CD / D test2019% to the current directory% test2019 
REM used for creating a file and performing open loop CMD window 
for / L %% i in ( . 1 , . 1 , 100 ) do (
 echo which is the file %% i content!> this is the first %% for loop testing of the i-th file .txt 
Start cmd % open cMD window% 
Explorer. %% open the current folder test2019 
) 
PAUSE

 

Run a result, the self-test!

Guess you like

Origin www.cnblogs.com/simple-li/p/11579017.html