当前位置:网站首页>Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
2022-07-03 15:57:00 【fyin1314】
problem :
Concerning Windows batch files: Is there a way to list all the files (or all of a specific type) in a certain directory and its subdirectories, including the paths relative to the current (or the search) directory in the list? About Windows Batch file : Is there a way to list all the files in a directory and its subdirectories ( Or all specific types ), Include relative to the current ( Or search for ) Path to directory ?
For example, if I want all the .txt files in the current directory and subdirectories with their full paths, I can do for example , If I want all in the current directory and subdirectories .txt File and its full path , I can do this
for /r . %%g in (*.txt) do echo %%g >> C:\temp\test.txt
or or
dir *.txt /b /s >> C:\temp\test.txt
and I will get something like I will get something similar
C:\test\Doc1.txtC:\test\subdir\Doc2.txtC:\test\subdir\Doc3.txt
If I do If I do
for /r . %%g in (*.txt) do echo %%~nxg >> C:\temp\test.txt
I will get something like I will get something similar
Doc1.txtDoc2.txtDoc3.txt
But what I really want is: But what I really want is :
Doc1.txtsubdir\Doc2.txtsubdir\Doc3.txt
Is it possible? Is it possible? ?
If my post is too confusing: I basically want List files recursively in Linux CLI with path relative to the current directory , but just for Windows. If my post is too messy : I basically hope Linux CLI Medium List The file has a path relative to the current directory , But only for Windows.
Solution :
Reference resources : https://stackoom.com/en/question/ZBRG边栏推荐
- Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
- 一些事情的反思
- Semi supervised learning
- [redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)
- 半监督学习
- 秒杀系统1-登录功能
- Visual upper system design and development (Halcon WinForm) -5 camera
- 首发!!lancet饿了么官方文档
- The difference between RAR and zip files
- Redis high availability and persistence
猜你喜欢
关于网页中的文本选择以及统计选中文本长度
App mobile terminal test [3] ADB command
Vs2017 is driven by IP debugging (dual machine debugging)
从 flask 服务端代码自动生成客户端代码 -- flask-native-stubs 库介绍
WinDbg analysis dump file
Second kill system 3 - list of items and item details
Baidu AI Cloud helps Shizuishan upgrade the smart health care model of "Internet + elderly care services"
【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示
Digital image processing -- popular Canny edge detection
Halcon and WinForm study section 2
随机推荐
Reading notes of "micro service design" (Part 2)
Approval process design
Calibre LVL
Microservice API gateway
Seckill system 3- product list and product details
软件逆向破解入门系列(1)—xdbg32/64的常见配置及功能窗口
"Remake Apple product UI with Android" (2) -- silky Appstore card transition animation
“用Android复刻Apple产品UI”(3)—优雅的数据统计图表
Embedded development: seven reasons to avoid open source software
Intelij idea efficient skills (III)
驱动与应用程序通信
Microservice - declarative interface call openfeign
Visual upper system design and development (Halcon WinForm) -4 Communication management
Visual upper system design and development (Halcon WinForm) -1 Process node design
App mobile terminal test [3] ADB command
Microservice - Nacos registration center and configuration center
CString的GetBuffer和ReleaseBuffer使用说明
请求头不同国家和语言的表示
Second kill system 3 - list of items and item details
自定义注解