-5

I need to write a batch file that goes into a folder and randomly swaps (renames) all the filenames. This folder has about 1000 files. So it is acceptable if there are few misses.

MD Luffy
  • 101
  • 1
  • I have to ask, why? And when you say randomly swaps, do you mean haphazardly or randomly? Do all the files make up a set of filenames that must remain constant? – Raystafarian Jul 23 '13 at 00:28
  • 1
    [related](http://superuser.com/questions/65966/batch-file-to-replace-a-single-character-in-windows-filenames?rq=1) take a look and try it out for yourself, then come back and tell us where you're stuck. – Raystafarian Jul 23 '13 at 00:31
  • "Do all the files make up a set of filenames that must remain constant" - yes, thats the tricky part. They are image sequences that need to randomized for each iteration. – MD Luffy Jul 23 '13 at 00:55
  • This random swapping reminds me of the [ripper](http://www.f-secure.com/v-descs/ripper.shtml) virus, which swapped information to corrupt a disk slowly. I would be wary of answering this question, as it seems to have a malicious intent (even if op wants to do this in jest) – SeanC Jul 31 '13 at 13:57
  • @SeanCheshire dude seriously ? You didnt bother to ask my use case but make ridiculous allegations like these. (Its related to making slideshow videos with ffmpeg for those who care) – MD Luffy Aug 05 '13 at 21:43

2 Answers2

1

Are you connected to a network?

Are there any others (computers) on the network?

Do they know your password and username on the targeted user/computer

If so change your password, if a person on the network knows those details, they can modify your computer in any way, they could be the culprit, and are there any other changes that you have noticed, try change your password, if you don't have one, then make one, this will block out anyone from accessing your user, not your whole computer, but probably wont do anything else if it was just that folder

0

Appends random number to file name and preserves extension:

@echo off
setlocal enabledelayedexpansion

for %%F in ("C:\my photos\*.*") do ( 
    rename "%%~fF" "%%~nF!random!%%~xF" || (
        echo ERROR: "%%~fF"
    )
)

exit /B 0
Vlastimil Ovčáčík
  • 2,748
  • 1
  • 24
  • 32