Script request

Soldato
Joined
18 Oct 2002
Posts
7,515
Location
Maidenhead
Hi all,

Wonder if someone could help me write a quick script to scan a folder for iso files, then create a folder with the name of the iso, and move that iso to the new folder?

Ta
 
This is what I would do.. (I'm no good at scripting mind)

Windows search *.iso on the folder.

Cut all files into 'ISOS' folder

Then in CMD, go into that ISOS folder and type..

dir /b > files.txt

open this file in notepad, and find/replace the .txt with 'nothing'

now copy all of the bare filenames into excel, paste into b1 downwards

then in a1 downwards, fill with.. mkdir

now copy A and B, paste into notepad, and copy the 'tab' space, and find/replace this with a 'space', save the file as maker.bat and run that in the dir you want the subfolders created.

You can further use excel/notepad to move this files into the respective subfolders

long way of doing it, but faster than manually, if there's a lot of them
 
PHP:
@echo off

for /f  "tokens=*" %%a in (
'dir /b *.iso'
) do (
	echo Creating folder %%~na
	mkdir "%%~na"
	echo Moving %%a to folder
	move "%%a" "%%~na"
)


Try this. Create a file named say 'move.bat' and place it in the same folder as all the ISOs then run it.

Make sure you have backups just incase!
 
Back
Top Bottom