Friday, July 31, 2009

You can put environment variables in Windows command prompts

I never knew you could do this. I learned this from a page about putting the machine name into the command prompt. The machine name often shows up on Solaris/Linux prompts, but you don't usually see it on Windows. Anyway, you do it via an environment variable, using the standard prompt command:

prompt [%computername%]$S$P$G

gives you a prompt that looks like [mymachinename] c:\temp>

The original page that gave me the idea describes how you can put this code into a registry value so that it gets executed for every console you run.

No comments:

Post a Comment