Trick for command-line junkies

I'm still very much a command-line kind of guy. I get around the Windows UI just fine, but frequently I find it quicker to just drop to a command prompt to accomplish certain tasks (especially since Explorer generally sucks at launching apps with command line params). I like the "My Documents" feature of Windows, as it keeps documents easily accessible in from the Windows Explorer. However, when I want to perform a command line operation in My Documents, it's a pain to navigate there, even with path completion. Plus, C:\Documents and Settings\Kevind\My Documents is a long string, so my cursor starts 2/3 of the way over in the window before I've typed a single character.

I recently hit upon the idea to create an NTFS junction point off the root directory (I called in mydocs) that points to the "My Documents" directory. I used the Junction tool from the wizards at Sysinternals. It worked like a charm, and made "My Documents" much more accessible from the command line. Of course, this solution wouldn't work too well on a machine that is shared amongst multiple people. But for me it works peachy.

 

 

4 Comments

  • cd %userprofile%\my documents works as well.





    --Brian

  • Sweet, thanks for the link! I too am a CLI junky, but I had been creating batch files for things like this. e.g. desktop.bat:





    cd \documents and settings\%username%\desktop





    Cheesy, but it saved me some keystrokes. This junction tool is a much better solution though.

  • Look out! :-)





    I had a bunch of junction points in my filesystem for this sort of thing, but I removed them recently.





    Why? I found that most programs, and in particular Sophos don't bother to spot the difference between a normal directory and a junction point. This turned out to be a real pain with drive scanning programs.





    E.G. One of the junction points I was using was from "My Documents" to the root of a large source tree (on another drive). Having the JP there meant that Sophos scanned it twice. As it was set up (by corporate IT) to do the scan every lunchtime, it was starting to really p**s me off. Also, it turned out that the (v. frequent) updates of the Sophos software cause it to dicard any exclusion lists you have set-up. Argh!





  • I use doskey macros to cd to places I frequently use. Amazing how much DOS stuff is still useful.

Comments have been disabled for this content.