You have a list of files:

You have a list of files:
file1.jpg, file5.jpg, file9.jpg
You need change their filenames so that they are in sequential order, without any numerical gaps.

file1.jpg, file2.jpg, file3.jpg

You may only use a windows .bat script to accomplish the task.

How?

Attached: CNNvDtrump.jpg (600x319, 45K)

Other urls found in this thread:

youtube.com/watch?v=KEkrWRHCDQU
twitter.com/NSFWRedditImage

i dont code lol
i only play vidya and shitpost here :)

@echo off
ren file1.jpg file1.jpg
ren file5.jpg file2.jpg
ren file9.jpg file3.jpg

youtube.com/watch?v=KEkrWRHCDQU

what if there are a million files?

The question never asked for that.

@echo off
ren file1.jpg file1.jpg
ren file5.jpg file2.jpg
ren file9.jpg file3.jpg
...
ren file4865759.jpg file9999998.jpg
ren file5676376.jpg file9999999.jpg
ren file1471638.jpg file1000000.jpg

I use vim to copy and modify the line a million times with a single macro

retard

power shell
Dir | %{Rename-Item $_ -NewName ("file{0}.jpg" -f $nr++)}