Using for command to share power

Time:2020-3-25
Copy codeThe code is as follows:
for /r d:\wwwroot\web\chouwazi.com\ %i in (*.asp) do @echo %i >>c:\windows\temp\1.txt

List all the ASP files in the directory D: \ wwwroot \ web \, and save them in 1.txt under C: \ windows \ temp \
==========================Gorgeous dividing line

Copy codeThe code is as follows:
for /d %i in (d:\wwwroot\web\*) do @echo %i

This sentence shows all files under D: \ wwwroot \ web, including folders.
==========================Gorgeous dividing line============================

Copy codeThe code is as follows:
for /r d:\wwwroot\web\ %i in (*.*) do @echo %i >>d:\wwwroot\web1\1.txt

** under DOS, it means all
That is to say, display all files in D: \ wwwroot \ web1 \ and save them in D: \ wwwroot \ web1 \ 1.txt
*. * is any suffix. If it is changed to (*. Exe), all exe files of the directory and the following subdirectories will be listed
==========================Gorgeous dividing line

Copy codeThe code is as follows:
for /f %c in (d:\wwwroot\web\coon.asp) do @echo %c

View the content of coon.asp file
==========================Gorgeous dividing line============================

Copy codeThe code is as follows:
for /d %i in (???) do @echo %i

Type the name of the folder in the current path with only 1-3 letters
==========================Gorgeous dividing line

Copy codeThe code is as follows:
type F:\VIP\qq1369\database\#Collection.resx echo >>c:\windows\temp\1.mdb

Read the database configuration file of the opposite party through for or type, but the database changes the suffix, for example,. Resx
So we can’t download it. At this time, use the type command to copy the database to C: \ windows \ temp \, and then download it!
==========================Gorgeous dividing line============================

Copy codeThe code is as follows:
for /r F:\chouwazi.com\ %i in (*) do @echo %i

List all files in the F: \ chouwazi. Com \ directory
==========================Gorgeous dividing line

Copy codeThe code is as follows:
for /r d:\ %i in (2002910021.jpg) do @echo %i

Use this command to search the directory of 2002910021.jpg picture under D:.
From stinky socks blog

Recommended Today

Summary of computer foundation in autumn 2021 interview – Java foundation, JVM, spring framework

Series articles: Summary of computer foundation in autumn 2021 interview algorithm, data structure, design pattern, Linux Summary of computer foundation in autumn 2021 interview – Java foundation, JVM, spring framework Summary of computer foundation for 2021 autumn recruitment interview database, redis Summary of computer foundation for 2021 autumn recruitment interview – operating system Summary of […]