Page 1 of 1

FOR loop with selected files

Posted: 10 Apr 2022 10:35
by hellishvictor
Hi, with the following line in a batch file I want copy the name and extension of the selected files to the clipboard, but the thing is that if have selected three files, it creates three instances of cmd. How can I make it do all the task in only one cmd instance?

Code: Select all

FOR %%g in (%~nx1) do echo %%g|clip