Scripts for boring tasks
Here's a list of small scripts that have been making my life a lot easier. I also learned to love PowerShell in the process. If you're not familiar with PowerShell yet this might be a good starting point.
In my dev box I happen to have a lot of GeneXus Knowledge Bases, which impacts in the amount of Databases my local SQL Server has and the amount of web apps on both IIS and Apache Tomcat.
Every bat file here is in a directory which is in my PATH environment variable, that bat calls the real deal maker which is a PowerShell script with the same name under the folder ps.
Goes thru all your dangling images and removes them .
Goes thru all your IIS 'Default Web Site' web applications, and checks if the physical path it is aiming exists in your drive. If it does not, it removes the web app.
It can receive either the path to a GeneXus Knowledge Base or the path to a folder where many 'junk' Knowledge Bases exist. For every Knowledge Base it'll try to remove the SQL Server database and then remove the whole folder.
This one mightnot work for everybody. But in my local Apache Tomcat I only have disposable test apps, every once in a while they tend to pile up so this script goes thru all the web apps and removes them, with the exception of some well-known folders.
This is a unified script that does all of the above. I'll receive a Knowledge Base folder path and it'll try to find the associated web apps (IIS and Tomcat) and SQL Server databases and will try to delete everything on its way. After that it'll remove the MDF of the Knowledge Base and the folder with every file.