The Magic application of batch processing in improving the efficiency of Windows management
::1.3::echo. Show Blank Lines::A For loop for the value range loop@echo offEchoCreating file0.txt ~ file99.txtEcho.Echo.::for/l%%n in (0,1,99)/L indicates that the for statement loops within the specified range of values. The range is determined by in::In (0,1,99) means starting from 0, Step 1, End of 99 (inclusive) for/L%%n in (0,1,99) Do(Echo%%n >> file%%n.txt)EchoFile created.Pause
::1.4::Numeric Variables::The For loop processes the file. ::Delete the variable to avoid affecting the system or other batches. @echo offEchoBegin to change file nameSetex=.rarSet/A sum=0::each file in the current directory for%%m in (*) Do(::string judgments, in fact, have a better wording. ::%0 is the string of the current file's filename::if not "%%m" ==%0 (::This attempt is a failure.if not"%%m" = = "1.4.bat" (Ren%%m%%m%ex%::Add 1 to the SUMW valueSet/a sum=sum+1))EchoThere is total%sum%Files' name changed::Delete the variable to avoid affecting the system or other batches. Setsum=Setex=Pause
::1.5::about the current file, the current filename,@echo offEchoCurrent file name%0EchoCurrent file name%~n0EchoThis file is located on the path%~dp0EchoInitial work Path%CD%CDD:EchoChange the work path after%CD%Pause