Finding only shortcuts that point to a certain machine

0

I have 100s of short-cuts in various folders on my C: drive. (Windows 7)

Many point to folders on another machine called JANICE1.

Countless others point to JANICE2.

The remainder point to folders on my local computer.

What is the quickest way to find all the JANICE2 shortcuts?

(I can't even figure out how to list "all shortcuts" only, let alone "only JANICE2 shortcuts".)

I'm currently selecting every short-cut, 1-by-1, and hitting PROPERTIES and checking them manually. Ugh. There's got to be a better way.

Janice J

Posted 2015-01-12T23:42:58.663

Reputation: 1

this can easily be done with a script (vbs/powershell). Is that an option for you? what would you want to do with the shortcuts after you found them? – Syberdoor – 2015-01-13T11:10:52.443

Answers

0

This seems to work, from the DOS prompt, though the output is somewhat messy:

for /r %i in (*.lnk) do @find /N "JANICE2" %i

Hat tip


Better seems to be:

@echo off
for /f "delims=" %%a in ('dir *.lnk /b /s') do (
for /f "delims=" %%b in ('find "JANICE2" ^<"%%a" ^|find /c /v "" ') do (
if %%b GTR 1 >>"foundJANICE2.txt" echo %%a
)
)

Copy it to a file - like searchJANICE2.bat and run it from the CMD.

Your answer will be in foundJANICE2.txt

Hat tip

Danny Schoemann

Posted 2015-01-12T23:42:58.663

Reputation: 227