Home    Forum    News    Tool Box    About    Search 
article categories
Automotive
Computer
Electronics
Food and Cooking
Home Improvement
Household
Personal Finance
Pets and Animals
Pool and Spa
Recreation Vehicle - RV
article categories
How To Videos
SUBMIT ARTICLE Newsletter Signup
Newsletter Archive
DIY Links and Resources
Advertise Here

Buy Dean a Beer
Want FREE BEER? Click here.

123inkjets.com - Printer Ink, Toner, & More

Great Deals Every Day @ Geeks.com

Once You Know, You Newegg

Tool King Service, Selection, Satisfaction

Killer Command Line Tips 1

One of the most clumsy aspects of using the Windows command line is traversing the file system directories. Here are a few tips to save some keystrokes and time.

1) Use directory name masking. Did you know that you can use * as a mask in the CD command?
Example: cd \brainstrain
This can be shortened to cd \br*
The typed out portion must be unique or it will change to the first directory name that matches the mask.

2) When you CD to a long directory name with spaces in it where you would quote the name like "program files" you can leave out the last quote.
Example: cd "\program files"
can be shortened to cd "\program files
and... using tip 1 and 2, you can do this
cd "\prog*

3) You can drag and drop a folder from Explorer into a CMD window. Windows will paste in the full directory path including quotes. Once the path is in the CMD window, change focus to the CMD window, hit HOME to get to the beginning of the cmd line, then type cd /d (with insert on), then hit enter.
Note: the /d option of the cd command is only required if you included the drive letter in the path AND the drive is different than the current drive.

4) Use the "Open Command Window Here" power toy found here:
http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

This is the XP version that also works in Windows 2000 (afaik). With this power toy, you simply right click on a folder name in Explorer, then click Open Command Window Here. A new CMD window will be opened with the folder being the current directory.

5) Use environment variables. The following changes to the temp directory:
cd %temp%
or, change to the user profile directory:
cd %userprofile%


Note - Don't use the masking methods in batch files because as directories are added or changed, the mask may not change to the directory name you would expect. Always spell everything out in full in batch files.

These methods work in Windows 2000 and later operating systems (however... not tested with Vista).

Enjoy!

Look for more Killer Command Line Tips in the near future.

Author: FixingStuff
Article Date: 06-07-2007

AddThis Social Bookmark Button

Didn't find what you were looking for?
Try searching or posting a question in the HowToFixYourStuff Forum.


READER COMMENTS

No comments yet. Be the first to comment on this by using the form below.
Comment Posting Guidelines: Please only post comments relevant to this article. Registration is not necessary to post comments, however, a valid email address is required, but will not be shown here or published in any way. HTML and URLs are not supported.

Rules: No obscene, inflammatory or offensive content allowed. All comments are subject to review by a systematic process and/or human before being published. Any abuse of this is subject to being banned and reported. The use of the form below assumes the acceptance of these rules.
Post a Comment:

Leave blank for anonymous

Required, hidden [Privacy Statement]


  Did You Know...  
John Force hosted a pilot for television talk show, John Force: Off the Wall, during summer 1997.

Fun fact# 17

    © DC Systems 2007    
home | news | Tool Box | contact
      Get Firefox!