Batch script to delete all empty subdirectories.

Filed under: Uncategorized — Apneet Jolly at 2:16 pm on Thursday, May 15, 2008

I needed a script to delete all empty subdirectories, but the examples I found failed with directories with spaces in them, or would not let me pass the directory name to the script.

This bat file will do the trick.


@echo off
for /f "delims=" %%i in ('dir "%~f1" /ad /b /s ^| sort /R') do rd "%%i" 1>NUL 2>&1

The batch file will list all directories, in reverse order, and then attempt to delete each one.
rd will only delete empty directories.
The delims parameter stops spaces from being used as a delimiter.
%~f1 lets you pass a directory name to the script.

We use IO redirection at the end of the script to prevent warnings from being displayed on screen.
1>NUL 2>&1
This code says to redirect standard output (handle 1) to NUL, and also take sderr (handle 2) and redirect that to handle 1.

Thanks to Raymond Chen for the original code.

Sguil 0.7.0 released

Filed under: Uncategorized — Apneet Jolly at 9:58 am on Wednesday, March 26, 2008

As a former MSSP (managed security service provider) security analyst, I’m always on the lookout for tools to better help me watch and analyze network traffic. Sguil provides for an analyst centric toolkit for monitoring network traffic, and has proved to be very useful in the past.

Version 0.7.0 was just released, and I encourage people to check it out.

Sguil 0.7.0

Digital Books, the Easy Way

Filed under: College — Apneet Jolly at 12:53 pm on Thursday, March 9, 2006

Especially since I bought my Tablet PC, I’ve always wanted digital copies of my books. Unfortunately, even with a decent scanner, scanning books takes an extremely long time. However, with modern day digital cameras, we can vastly reduce scan time by using a camera to photograph our book.

(Read on …)

Polarity

Filed under: Uncategorized — Apneet Jolly at 8:47 pm on Thursday, January 12, 2006

Just recived this sweet board game Polarity…and managed to make a double leaner :)

108

On Paranoia

Filed under: Uncategorized — Apneet Jolly at 4:46 pm on Thursday, January 12, 2006

When browsing slashdot, I came across an interesting comment:

Bill Gates from Triumph of the nerds:

Success is a menace — it fools smart people into thinking they can’t lose.

That is absolutely the perfect quote to describe why Microsoft is the unbelivably paranoid company that it is. Bill always thinks Microsoft might lose and does any and everything (legal or not) to make sure that they don’t.

I think this summarizes an interesting viewpoint on paranoia; namely that paranoia in and of itself doesn’t have to be a bad thing. It’s an extended version of what one might deem a disaster recovery plan, but an ongoing continous plan.

Paranoia as a mindset especially in the InfoSecurity world can be a very good thing, it’s merely a way of looking at the world that continously analyzes it for potential failings, and asks the question - How can I mitigate this risk?

lorem ipsum

Filed under: Uncategorized — Apneet Jolly at 4:38 pm on Monday, October 24, 2005

lorem ipsum is standard dummy text…been used for a while.

Work In Progress

Filed under: Uncategorized — Apneet Jolly at 12:43 pm on Saturday, October 22, 2005

I’m currently working on setting up a combination wordpress/gallery2 blog/photogallery.

Should be fun:)

Jolly