Reputation: 91
I have used for loop for my script as given below:
for /f "tokens=* delims= " %%G In ('dir /a-d/b/s "%dest%\*.*"') do (
echo %%G >>%save_file%
)
Now when i am running this job it is printing path name of the files. I want to save only files name not the path.
Upvotes: 0
Views: 35
Reputation: 30113
This could work:
for /f "tokens=* delims= " %%G In (
'dir /a-d/b/s "%dest%*.*"'
) do ( echo %%~nxG >>%save_file% )
Upvotes: 1