当前位置:网站首页>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边栏推荐
- Driver and application communication
- 利用MySQL中的乐观锁和悲观锁实现分布式锁
- ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
- Detailed pointer advanced 1
- Second kill system 3 - list of items and item details
- Approval process design
- Find mapping relationship
- Function introduction of JMeter thread group
- Reflection on some things
- 首发!!lancet饿了么官方文档
猜你喜欢

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

Visual upper system design and development (Halcon WinForm) -3 Image control

Microservice sentinel flow control degradation

突破100万,剑指200万!
![[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解](/img/cd/00954b9c592c253d42e6a3b8298999.jpg)
[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解

Project -- high concurrency memory pool

Digital image processing -- popular understanding of corrosion and expansion

Break through 1million, sword finger 2million!

How are integer and floating-point types stored in memory

Function introduction of JMeter thread group
随机推荐
Go语言自学系列 | golang中的if else if语句
Nifi from introduction to practice (nanny level tutorial) - flow
pycharm错Error updating package list: connect timed out
"Remake Apple product UI with Android" (3) - elegant statistical chart
秒杀系统3-商品列表和商品详情
Popular understanding of ovo and ovr
Visual upper system design and development (Halcon WinForm) -3 Image control
突破100万,剑指200万!
VC下Unicode和ANSI互转,CStringW和std::string互转
请做好3年内随时失业的准备?
Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
Wechat payment -jsapi: code implementation (payment asynchronous callback, Chinese parameter solution)
Why can't strings be directly compared with equals; Why can't some integers be directly compared with the equal sign
驱动与应用程序通信
Use percent sign in CString
win32创建窗口及按钮(轻量级)
秒杀系统1-登录功能
Reading notes of "micro service design" (Part 2)
CString getbuffer and releasebuffer instructions
工资3000,靠“视频剪辑”月入40000:会赚钱的人,从不靠拼命!