bsmith
bsmith

Reputation: 409

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'

Upvotes: 3

Views: 2982

Answers (1)

Rahmani
Rahmani

Reputation: 877

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

Upvotes: 4

Related Questions