当前位置:网站首页>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.txtor or
dir *.txt /b /s >> C:\temp\test.txtand I will get something like I will get something similar
C:\test\Doc1.txtC:\test\subdir\Doc2.txtC:\test\subdir\Doc3.txtIf I do If I do
for /r . %%g in (*.txt) do echo %%~nxg >> C:\temp\test.txtI will get something like I will get something similar
Doc1.txtDoc2.txtDoc3.txtBut what I really want is: But what I really want is :
Doc1.txtsubdir\Doc2.txtsubdir\Doc3.txtIs 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边栏推荐
- First!! Is lancet hungry? Official documents
- Under VC, Unicode and ANSI are converted to each other, cstringw and std:: string are converted to each other
- App mobile terminal test [5] file writing and reading
- C language brush questions ~leetcode and simple questions of niuke.com
- Tensorflow realizes verification code recognition (II)
- 半监督学习
- Seckill system 3- product list and product details
- Vs2017 is driven by IP debugging (dual machine debugging)
- Microservices Seata distributed transactions
- The difference between mutually exclusive objects and critical areas
猜你喜欢

Microservice - declarative interface call openfeign
![[200 opencv routines] 217 Mouse interaction to obtain polygon area (ROI)](/img/04/460734209ec315c5c02cb3fae4bf0e.png)
[200 opencv routines] 217 Mouse interaction to obtain polygon area (ROI)

秒杀系统2-Redis解决分布式Session问题

子类隐藏父类的同名函数

使用AUR下载并安装常用程序

工资3000,靠“视频剪辑”月入40000:会赚钱的人,从不靠拼命!

Second kill system 3 - list of items and item details

Digital image processing -- popular Canny edge detection

Microservice - Nacos registration center and configuration center

【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示
随机推荐
App移动端测试【3】ADB命令
Semi supervised learning
Under VC, Unicode and ANSI are converted to each other, cstringw and std:: string are converted to each other
UnityShader——MaterialCapture材质捕捉效果 (翡翠斧头)
Microservices - load balancing ribbon
嵌入式开发:避免开源软件的7个理由
【OpenCV 例程200篇】217. 鼠标交互获取多边形区域(ROI)
Popular understanding of decision tree ID3
Persisting in output requires continuous learning
Download and install common programs using AUR
How idea starts run dashboard
Mongodb installation and basic operation
[list to map] collectors Tomap syntax sharing (case practice)
秒殺系統3-商品列錶和商品詳情
[redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)
Unity function - unity offline document download and use
Problems of CString in multithreading
Microservice - Nacos registration center and configuration center
通过进程PID获取可执行文件路径(QueryFullProcessImageName)
Visual upper system design and development (Halcon WinForm) -1 Process node design