FOR loop with selected files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
hellishvictor
Posts: 1
Joined: 07 Mar 2022 06:30

FOR loop with selected files

#1 Post by hellishvictor » 10 Apr 2022 10:35

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
Cheers.

Post Reply