Fog Creek Software
Discussion Board




Customizing DOS prompt?

In researching that tab-completion for Win2k's Command Prompt, I wonder if anyone does a lot of work thru DOS and has customizations to share.

Cygwin sometimes doesn't interact well with DOS programs when I use the Up key for command history... I also use Eshell under Emacs, which has DOS-style tab completion on by default.

Tayssir John Gabbour
Wednesday, June 23, 2004

What more do you want besides the "prompt" command?

Junkster
Wednesday, June 23, 2004

In other words:
>Prompt $p$g  -- gives you the 'normal' %path%> set.

AllanL5
Wednesday, June 23, 2004

type:

prompt bash>

...at least it makes you feel better.

horace
Wednesday, June 23, 2004

Ahh, cool, "prompt $V$_$P$G" shows win2k version, which seems pretty useful.

> "What more do you want besides the 'prompt' command?"

Good question. ;) I assumed that people were able to make DOS really powerful or something, like a full-featured shell. With some basic unix commands like "history", etc. Typing in "help" doesn't show many things.

Maybe many people use Cygwin/Emacs-Eshell though...

Tayssir John Gabbour
Wednesday, June 23, 2004

Yep.  DOS just isn't up to the task.  I've seen people who were good with the dos shell, meaning that they were just very fast typists.  Precious few shortcuts / tweakability there.

horace
Wednesday, June 23, 2004

Good use of the DOS prompt seems to involve using it to run other programs. What else is it good for?! (Actually Win2K's DOS prompt seems tons better than the Win9x one, but I've been using 4NT for too long to be really bothered about investigating further.)

Useful customisations I can think of are:

1. Enable tab completion;
2. Download ProggyClean font for DOS prompt;
3. Set console window to 120x60 with 4000-line scrollback buffer;
4. Set QuickEdit mode as default. (You can right-click to paste clipboard text at cursor.)

This doesn't help that much, but does stop it being so actively offensive. Step 2 is optional, and down to preference, but if you want to do some customizing you may as well go the whole hog.

Tom
Wednesday, June 23, 2004

Download TweakUI (in with MS Windows Powertools I think). It gives you tab completion.

PDF
Wednesday, June 23, 2004

All the power-user stuff I've seen has been with JPSoftware's 4NT.  Tab-completion, recent command history and completion, recent directory history, "...." shorthand for "..\..\..", aliases, etc.

I couldn't deal with not having my recent command history - similar to CTRL-R in bash, except you type first and then hit up/down to cycle through the commands that start with whatever you'd typed.

[ObDisclaimer: No affiliation with JPSoftware except being a customer.]

schmoe
Wednesday, June 23, 2004

You can turn on command line completion (googe, not MS documentation is your friend):

http://www.winguides.com/registry/display.php/826/

Registry Settings
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]
Value Name: PathCompletionChar
Data Type: REG_DWORD (DWORD Value)
Value Data: Hex Control Character

Registry Settings
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]
Value Name: CompletionChar
Data Type: REG_DWORD (DWORD Value)
Value Data: Hex Control Character

hoser
Wednesday, June 23, 2004

doskey
title
color

mb
Wednesday, June 23, 2004

There are some other things in default cmd and default set of commands:

help cmd
- tells you most registry keys that changes cmd
- describes "for" command that is light version of ` and text parsing.

findstr - is grep

cd /d - helps to jump between discs

F7 key - command history (the others do something too)

tasklist and taskkill (WinXP/W2K3) - process management

net  - manages almost everything (connections, services)

cscript //Nologo //H:CScript //s - will set up JScript/VBScript to run in console mode rather window mode. Makes running scripts way easier. And there is WMI available through JScript/VBScript to do almost anything with the machine...

WildTiger
Wednesday, June 23, 2004

Wanna Texas Flag for you DOS Prompt?  Course ya do:

PROMPT $_$_$_$e[22;3H$e[1m$e[44m  $e[47m$e[23;3H$e[44m * $e[47;41m$e[24;3H$e[44m  $e[41m  $e[40m  $p$g$e[0m$e[2C

Hank Hill would be proud.

hoser
Thursday, June 24, 2004

Whoops, something happened there.  You can get it here:

http://www.filelibrary.com:8080/Contents/DOS/54/81.html

hoser
Thursday, June 24, 2004

Argh. It's not a DOS prompt, it's an NT command prompt!

(NT guys hate it when people call it the DOS prompt...)

Mike Treit
Thursday, June 24, 2004

I use DOS for:

- Getting list of files in a directory:

dir [*.*] > file.txt
(And then import it into Excel and perform all sorts of operations on it)

- Creating batch files to perform set of tasks (e.g. to unregister, re-register and set attibutes of a COM server):

cd progra*\mydir
comserver /unregserver
pause
comserver /regserver
pause
dcomcnfg

- Sending messages to other people:

net send machinename this is a message
(Create a batch file to send message to group of machines, like myteam)

- Connecting to other machines using specific user accounts:

net use \\machine /user:domain\myaccount

- Making settings in IIS:

cscript adsutil.vbs ...
(Lets you get/set settings for all options in IIS, even the ones not visible from the UI (e.g. CGITimeout option in IIS 6.0))

etc.

T-90
Thursday, June 24, 2004

Thanks for the helpful responses! I'm sure there were many a hand smacking forehead, wondering why they didn't try out pressing keys like f7.

Yes, there had to be something like JP Software's 4NT.

Sorry for calling it the DOS prompt. ;) I guess if I were deeply into Windows I'd see why that would be an important distinction...

Tayssir John Gabbour
Thursday, June 24, 2004

PROMPT Error!

Have some fun with a co-worker...

Rob VH
Thursday, June 24, 2004

*  Recent Topics

*  Fog Creek Home