• Home
  • About
  • Contact

  • Entries (RSS)
  • Comments (RSS)

hosted by Dreamhost
 
August 2008
S M T W T F S
« Jul    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archive for the ‘Downloads and Tools’ Category

A Quick Little Utility

Thursday, February 28th, 2008

Real updates are coming soon, I promise.  It has been a busy week but I have a couple draft posts floating around.  In the mean time here is a quick little batch file I threw together years ago (so please excuse the horrible syntax) that might come in handy: up.cmd

Essentially it is a quick way of traversing up a directory structure on the command line in Windows, so you don’t have to keep typing "cd ..\..\..\..\".  Just drop it in your path somewhere (after verifying that this isn’t my clever attempt to get you to install a trojan) and you are good to go.

It has two modes of use.  The first mode you provide one parameter- the number of directories to go up.  For example: "up 3" to go up 3 directories.

C:\Windows\System32\drivers\etc>
C:\Windows\System32\drivers\etc>up 3
C:\Windows>

In the second mode you provide no parameters, instead you just type "up".   It will then provide you with the curious UI option "[S,U]?" which is prompting to Stop or go Up.  If you press "u" it will go up one directory and prompt again.  When you want to stop you hit "s" .  This mode is really useful when you are really deep within a source archive and want to back your way up to some parent directory, but don’t want to count how many directories you want to go up.

C:\Windows\System32\drivers\etc>up
C:\Windows\System32\drivers\etc [S,U]?U
C:\Windows\System32\drivers [S,U]?U
C:\Windows\System32 [S,U]?U
C:\Windows [S,U]?S

C:\Windows>

Hey, lay off me. I wrote this almost a decade ago for myself and usability for the masses wasn’t really my intent (nor robust maintainable code.  I’m not really sure what the heck I was trying to do when I look in the batch file; that’s why comments are a good thing kids).  I just figured I would share this with all of you as you might find it useful.  Also, I keep forgetting to put it on my work machine and they prevent me from reaching my skydrive account while at work, where I have a backup, so now I have a convenient place to download it.

I’ll also post a couple entries of more substance in the near future (probably this weekend) and possibly a couple of PowerShell scripts I am working on, once I finish them and make them presentable (since I don’t have the excuse of being young and lazy like I do with up.cmd).  I’ve decided PowerShell is amazingly cool, but also takes quite a bit to get used to, being very different than any command line shell I have used.  Anyway, I have a slightly buggy netcat clone that I am writing in shell script as well as a couple other little utilities that I will put out where other people can tinker.

~Joshbw