Re: windows power shell

  • From: Ben Humphreys <brh@xxxxxxxxxxxxxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 14 Jul 2011 22:59:16 -0400

To use an environment variable at a command prompt or within a batch file, the environment variable should be enclosed in %s such as:


echo %path%

This should output the value of the PATH environment variable. No need to get Windows Power Shell involved. It should be just that simple.

Ben

At 10:36 PM 7/14/2011, you wrote:
Greetings.
I am on windows 7 and am trying to run some batch commands, for which I need
to know what is the syntax to get at the value of an environment variable?
I try %PATH%, %PATH, and even $PATH like in unix, but it all fails to expand
the value of the variable.
Since power shell apparently supports such unix-esque names as ls and pwd, I
am perplexed how to get it to pick up arguments.

BTW:
echo $PATH
prints nothing, whereas the % signs just get passed through as if it is not
a special syntax, as in a dos window.

So I suppose I'll get rid of power shell and use the dos window where the
args are predictable.

Now in the time it took to type this I could have done that.  Comments
welcome.
Thx.
--le

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: