Hi friends,

Please guide me how to create a batch file to fit this scenario,

"I have a Folder Named Addons which has 110 Folders which themselves has many sub folders and files of differnet extentions for eg(C:\Program Files\OpenERP\Addons). In this i have to leave around 15 decided Folders and their contents in Addons and i have delete the remaining Folder. The Number of folders and Their Names may vary every time depending on the Computer.

I have to use batch file both in Windows XP and Windows 7.

I am new one to create batch files. Please guide me.

Please rephrase your question with more clarity so that it can better be answered. It will be hard to help you unless you specify some sort of guidelines for how you want to choose what to delete. In general though, I have included an example below showing a program that simply deletes a directory.

@echo off
rmdir /s /q "PATH_TO_YOUR_DIRECTORY_HERE"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.