Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows command line - how to specify range?

In unix, to copy a set of files, I can do something like:

cp /mydocuments/ID00{1..5}F /somewhere

what would the equivalent command in windows command line look like? I tried '(1,1,5)' instead of '{1..5}', but that doesn't seem to work.

Edit: 'Windows command line'

like image 288
bsmith Avatar asked Sep 14 '25 23:09

bsmith


1 Answers

You can use something like this:

for /l %f in (1,1,5) do copy \mydocuments\ID00%fF \somewhere

The "/l" is mandatory if you want to use range.

for /l %f in (start, step, end) do...
like image 175
Rahmani Avatar answered Sep 16 '25 13:09

Rahmani