0

Hi all,

this is a quite simple question. In windows, I wan't to set an environment variable to contain a cmd prompt command that will open an explorer window from the command prompt current directory. I am aware of the >explorer <path> command and want to make use of the %cd% variable wich contains current work directory. So >explorer %cd% does the job, so I want to store it as a string in an environement variable. If I do >set e=explorer %cd%, %cd% will be replaced with its current value when the >set is performed, which is no good because "e" will always contain the same directory, the one where I was when I did the >set. If I do >set e=explorer %%cd%% then the set parses "explorer %cd%" and a subsequent >echo %e% will return "explorer %cd%" which looks good. But when I run it: >%e% , explorer opens in MyDocuments, just like it would do if I would type >explorer c:\bad_path ...

Any help would be greattly appreciated. Also I feel like I should not be using environment valiables to do this. On Unix, I use Alias to make commands shorter, is there a Windows CMD prompt equivalent?

Many thanks.

Tristan.

Edited by etm9413: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Aia
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.