Map Deletetion.

Forum for alternative clients, mods & discussions on the same.
Silushun
Posts: 110
Joined: Thu Mar 08, 2012 7:13 pm

Map Deletetion.

Post by Silushun »

Hey guys, how do I create a .run bat file to delete map folders with less than 16 tiles in it? I'm fed up of not being able to create a good map cause everytime i look for a folder BAM theres a billion folders in there.

Thanks
User avatar
BlackKopcap
Posts: 95
Joined: Sun May 23, 2010 1:46 pm

Re: Map Deletetion.

Post by BlackKopcap »

Silushun wrote:Hey guys, how do I create a .run bat file to delete map folders with less than 16 tiles in it? I'm fed up of not being able to create a good map cause everytime i look for a folder BAM theres a billion folders in there.

Thanks

Here you are, VBS script, put it in client root folder and run. (Call script as mapdeleter.vbs or any you want)

Code: Select all

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(".\map\")
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(objSubfolder)
if Folder.Files.Count < 16 Then errResults = objSubfolder.Delete
Next
User avatar
h3retostay
Posts: 213
Joined: Thu Jul 08, 2010 2:25 am

Re: Map Deletetion.

Post by h3retostay »

BlackKopcap wrote:
Silushun wrote:Hey guys, how do I create a .run bat file to delete map folders with less than 16 tiles in it? I'm fed up of not being able to create a good map cause everytime i look for a folder BAM theres a billion folders in there.

Thanks

Here you are, VBS script, put it in client root folder and run. (Call script as mapdeleter.vbs or any you want)

Code: Select all

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(".\map\")
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(objSubfolder)
if Folder.Files.Count < 16 Then errResults = objSubfolder.Delete
Next

Every time I use this I get a "Path not found" error

Return to “The Wizards' Tower”