CMD for Memo

Source: Internet
Author: User

============= parameter/d (parameter can only display the directory name under the current directory) ===================REM Display in the D:\work\ directory with*.txt matching files (if the error is%i->i) for%iinch(D:\work\*.txt) Do@echo%I REM displays all directories under the C-Packing directory for/d%iinch(c:\*) DoEcho%i rem shows the current directory under the name only 1-3-Letter catalogue for/d%iinch(???) DoEcho%I============= parameter/R (searches for all files in the specified path and in all subdirectories that match the set) =================REM Put the C-packing directory, and the subdirectories of each directory below all the EXE files are listed.!!!! for/r \%iinch(*.exe) DoEcho%Irem enumerates all directories of the C disk for/r \%iinch(boot. INI) DoEcho%Irem Enumerating D\backup directories for/R D:\backup%iinch(1) DoEcho%i rem good search command listing the directory where the boot. INI exists for/r \%iinch(boot. INI) Do ifExist%i echo%IThe ============= parameter/L (the set represents a sequence of numbers in increments from start to finish.) can use a negative Step) ===============rem Open 5 cmd windows for/L%%iinch(1,1,5) Dostart Cmdrem established from 1~5 A total of 5 folders for/L%iinch(1,1,5) Domd%Irem established from 1~5 A total of 5 folders for/L%iinch(1,1,5) DoRd/q%I============= parameter/F (use file parsing to process command output, string, and file contents.) )===============REM can also create a bat file code as follows: @echo Offecho^"1111>temp.txtEcho"2222">>Temp.txtecho3333^">>temp.txtEcho"4444" ->>Temp.txtecho^" -" -"55>>temp.txtrem View file content Filter Quotes~I (the first and last quotation marks) for/F"delims="%i in (temp.txt) do echo%~Irem Displays file full pathname (such as C:\iNodeLog instead of Inodelog) for/F"delims=="%i in ('dir/b') do @echo%~fi%~i-Remove any quotation marks ("), expand%I%~fi-Will%I extend to a fully qualified path name%~di-will only%I extend to a drive letter%~PI-will only%I extend to a path%~ni-will only%I extend to a file name%~xi-will only%I extend to a file name extension%~si-The extended path contains only short names%~ai-Will%I extended file attributes to a file%~ti-Will%I Date extended to File/Time%~zi-Will%I Expand to the size of the file%~ $PATH: I-Find the directory that is listed in the PATH environment variable and the%I expanded to find the first fully qualified name. If the environment variable name is not defined, or if no file is found, the key combination expands to an empty string to combine modifiers to get multiple results:%~DPI-will only%I extend to a drive letter and path%~nxi-will only%I extend to a file name and extension%~FSI-will only%I extend to a full path name with a short name%~DP$PATH:I-Search for the directory in the PATH environment variable and the%I Expand to the first drive letter and path found. %~ftzai-Will%I extend to an example of a DIRREM analysis command output similar to an output line: (Enumerates the environment variable names and values in the current environment.) ) for/F"usebackq tokens=1* delims=="%i in ('Set') do @echo [%i----%examples of J]rem parsing strings: for/F"usebackq tokens=1,2,3* delims=-,"%iinch('AA bb,cc-dd ee') DoEcho%i%j%k%Examples of lrem analysis files for/F"usebackq eol=; tokens=1,2* delims=,-"%iinch("C:\temp.txt") DoEcho%i%j%k

CMD for Memo

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.