0

The code below will list all files from the selected directory. How to make it list only files with one extension, like pdf?

[HKEY_CLASSES_ROOT\Directory\Shell\4_content-list-pdf\command]
@="cmd /c dir \"%1\" /b /o:gn | clip"
3
  • Have you tried \"%1\*.pdf\"? or \"%1\\*.pdf\"?
    – DavidPostill
    Jun 29, 2017 at 12:32
  • The second string works like charm - thank you!
    – Rayearth
    Jun 29, 2017 at 12:46
  • Great!. I will add an answer :)
    – DavidPostill
    Jun 29, 2017 at 12:49

1 Answer 1

1

How to make it list only files with one extension, like pdf?

You can replace \"%1\" with \"%1\\*.pdf\" as follows:

[HKEY_CLASSES_ROOT\Directory\Shell\4_content-list-pdf\command]
@="cmd /c dir \"%1\\*.pdf\" /b /o:gn 

Note:

A small number of commands follow slightly different rules, FINDSTR, REG and RUNAS all use \ as an escape character instead of ^

Source syntax


Further Reading

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .