How to make DOS look even more like Unix

August 10, 2005, 11:45 AM —  ITworld.com — 

One of the other problems that I ran into when trying to make my DOS prompt behave more like my Unix systems was how to invoke my carefully crafted macros every time I opened a new DOS command window. When I put the commands to change my prompt and invoke my macros in a batch file and then ensured that this batch file was on my search path, I could reduce the effort that I had to make to running the batch file every time I opened a command prompt. I've since learned that it is possible to have my batch file invoked automatically whenever I open a DOS window (i.e., run cmd.exe). So, in this week's column, we're going to examine how this can be done.

To quickly review how I captured and then restored my macros in the first place, recall that I created my macros with the doskey command and then stored them in a text file by using the doskey /m command and redirecting the output to a file:

>doskey /m > C:\batfiles\macros.txt

I then created a batch file which both changed my prompt (setting it to "> " with the DOS command "prompt=$G$S") and activated my macros with the command "doskey /macrofile=C:\batfiles\macros.txt".

> type \batfiles\customize.bat
@echo off
:: set up macros and custom prompt

doskey /macrofile=C:\batfiles\macros.txt
prompt $G$S

To effect the changes in my prompt and available macros, I then had to run my batch file every time I opened a DOS command window. I would open a window and then type "customize" (NOTE: To run a batch file, you type its file name without the .bat file extension). So now, I want this all to happen without my having to remember to type "customize".

Before we get started, however, we first have to decide whether we want our macros to be invoked only for a particular individual or for everyone who uses the system. Most PCs are used solely or predominantly by a single individual. I dare say that this is why they are referred to as "personal" computers. But, if you're working on a shared system, you may want to make your system changes so that everyone can use them.

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world

I like it!
Close

On Twitter now

dos

Powered by Twitter
You are logged in | Sign out
Sign in and post to Twitter

What are you thinking?

Cancel Tweet sent

On Twitter now

Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
peer-to-peer

Esther Schindler
If the comments are ugly, the code is ugly

claird
SVG a graphics format for 21st century

pasmith
Take Chrome OS for a test spin

Sandra Henry-Stocker
Solaris Tip: Have Your Files Changed Since Installation?

sjvn
64-bits of protection?

jfruh
Android fragments vs. the iPhone monolith

mikelgan
What Gizmodo missed about the Pro WX Wireless USB disk drive

 

Where Google Chrome security fails: the password
I heard mention that the Chrome OS will have some sort of encryption available a la bitlocker. If it's possible to encrypt personal data using another password or key, then it may have potential for very secure data.... And Ubuntu has an 'encrypt home directory' option, perhaps google should follow suit.
- Dann

Join the conversation here

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace