0

I would like to add a function to the context window (right-click) in Explorer.

I want it to send the list of selected files to print on the default printer.

I tried

@echo off
dir %1 /-p /o:gn > “%temp%Listing”
start /w notepad /p “%temp%Listing”
del “%temp%Listing”
exit

from this page which works on the entire contents of a folder.

That is not quite what I want - I want only files that have been selected in a folder.

I also see how to use "Copy as path" on a selection, but that would then need me to paste to a text file and print it.

So I am looking for a combination of both of these in a sense, but I only want a list of file names - no paths.

Goal:

  1. I select multiple files in a directory
  2. I right click and choose the function
  3. List of filenames only are printed.

-edit-

figured it out. thanks for comments. Send to Menu was an extra step so put it on main context menu. requires this

registry

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\printlist]
@="Print List of Files Selected"
[HKEY_CLASSES_ROOT\*\shell\printlist\command]
@="singleinstance.exe \"%1\"  \"C:\\\\Windows\\printlist.bat\" \"$files\" --si-timeout 400"

bat file

:: Get the date/time
FOR /f %%a in ('WMIC OS GET LocalDateTime ^| find "."') DO Set _DTS=%%a
Set _datetime=%_DTS:~0,4%-%_DTS:~4,2%-%_DTS:~6,2%@%_DTS:~8,2%-%_DTS:~10,2%-%_DTS:~12,2%
Echo   %_datetime% ^%LF% >> "%temp%\Listing.txt"
for %%A in (%*) do (
echo %%~nA ^%LF% >> "%temp%\Listing.txt"
)
start /w notepad /p "%temp%\Listing.txt"
del "%temp%\Listing.txt"
exit
  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?. – DavidPostill Oct 2 '18 at 21:57
  • Have you tried adding a pipe to filter results? – Sunnyskyguy EE75 Oct 3 '18 at 15:59
  • Add a batch file to the send-to context menu. The selected filenames would be passed as parameters. – Yorik Oct 3 '18 at 17:29
  • I copy the send-to link to the folder itself then I can easily add apps in the send-to extension menu, thus a batch file or a notepad++ editor or whatever is simple. – Sunnyskyguy EE75 Oct 3 '18 at 18:09
  • Please do not edit your original question to include an answer. Instead, post an answer on your question. (Your question may be reopened soon at which time you can do this.) – Twisty Impersonator Oct 11 '18 at 12:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.