A
A
AirFlare2021-04-05 23:42:17
cmd/bat
AirFlare, 2021-04-05 23:42:17

How to get a list of symlink files from a directory?

Good day! How to get a list of symlink files from a directory? Some details:
There is a directory X, in which there are symlink files, they, along with the path to them, must be output to a file so that the lines in it look like this:

C:\way\file1
C:\way\folder\file2

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2021-04-06
@AirFlare

In the dir command, the /al switch causes it to display only links. The /ad switch is for files only.
You can combine them like this:
dir /a-dl /b /s C:\way\
See the help for other keys.
PS: Thanks for the question. Previously, this was somehow not necessary. Discovered new possibilities for dir :)

P
pumpkinm, 2021-04-06
@pumpkinm

for /r %%i in (*.*) do dir "%%i" | find "<SYMLINK>" >nul && echo %%i>> out.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question