First question:

I can list path names & folder names, but I have a problem.

I don't need path names, look "<-- this":

C:\Users\Ad\Desktop\ready_pc\data\daiva\a\building <-- this.
C:\Users\Ad\Desktop\ready_pc\data\daiva\a\building\daiva.dds

My batch command:

dir /b /s > fileslist.txt

Another question:

I need to change imported file path names:

Imported:

C:\Users\Ad\Desktop\ready_pc\data\daiva\a\building\daiva.dds

Must be:

d:\another_work\ready_pc\data\daiva\a\building\daiva.dds

Any ideas?

有帮助吗?

解决方案

add another parameter /a-d. This means "Attribute: NoDir":

dir /b /s /a-d

EDIT (replacing string adapted to your needs):

@echo off
Setlocal EnableDelayedExpansion
for /f "tokens=*" %%i in (fileslist.txt) do (
 set line=%%i
 set line=!line:C:\Users\Ad\Desktop\=d:\another_work\!
 echo !line! >>newfile.txt
)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top