The Magic application of batch processing in improving Windows management efficiency 01

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.