Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

! set var=value Not Working

Status
Not open for further replies.

yert33

Programmer
Feb 19, 2002
255
US
Simply trying to set an environment variable from within a prg.

I've tried
Code:
! SET PETMODE=VALUE
I've tried
Code:
RUN SET PETMODE=VALUE

No worky. Gotta be something simple.....

TIA
 

Yert,

Are you talking about DOS environment variables?

If so, you might try:

RUN CMD.EXE /C PETMODE=VALUE

but that's only a guess. In any case, won't it just set the variable for the current DOS session, which will in any case terminate immediately? Presumably, you want the setting to persist.

What exactly are you trying to achieve?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

boyd.gif

SweetPotato Software Website
My Blog
 
Mike - it only needs to last for the current session
Dave - Thank you
Craig - Thank you and that is a good link.

I found a better way to do what I was wanting to do anyway. But it was bugging me that it wasn't working.
Thank you all.
 
For anyone who comes across this thread who does need to permanently change environment variables, the answer is here:

Basically, just edit the registry here:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top