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"
  • Have you tried \"%1\*.pdf\"? or \"%1\\*.pdf\"? – DavidPostill Jun 29 '17 at 12:32
  • The second string works like charm - thank you! – Rayearth Jun 29 '17 at 12:46
  • Great!. I will add an answer :) – DavidPostill Jun 29 '17 at 12:49
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.