| View previous topic :: View next topic |
| Author |
Message |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Tue Nov 04, 2003 8:10 pm Post subject: |
|
|
Jules,
First off, I think I too am one of the few to remember that AST sixpacks were not cheap beer... (but an add-on card that added 256K+ of memory and a real time clock, among other things!)
But, back to env. vars... in W2k and XP if you set an system env. var. (My computer --> properties --> advanced --> environment variables), you can see that it immediately takes effect by opening a command prompt and typing in "set" with no switches. Although I suppose I could write a script to control those windows, it is not a "clean" solution...
bbelcher's idea only works for the currently logged in user, and only then when it too is touched through the above mentioned edit window.
So far, it sounds to me that my only hope is FreezingFire's API solution.
double thanks... _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Tue Nov 04, 2003 8:18 pm Post subject: |
|
|
Mind power,
It sounds like your on to something... could you post the URL of that MSDN note?
thanks... _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Wed Nov 05, 2003 7:19 am Post subject: |
|
|
| Hooligan wrote: | | But, back to env. vars... in W2k and XP if you set an system env. var. (My computer --> properties --> advanced --> environment variables), you can see that it immediately takes effect by opening a command prompt and typing in "set" with no switches. |
It does seem though that the change only takes effect for newly spawn processes and
not for existing running applications. |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Nov 05, 2003 9:12 am Post subject: |
|
|
Possibly what I said applied to Win95/98/Me. It's only from memory, as I only have XP now, and I can't say that I've ever bothered with environment variables under XP. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Nov 05, 2003 9:14 am Post subject: |
|
|
Well, well. That's the first I've ever heard of this utility. Just goes to show even when you think you know everything, there's still something new to learn.  _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Nov 06, 2003 6:27 am Post subject: |
|
|
It's just as mindpower said. The below script appears to set environment vars for even a running app if it responds to WM_SETTINGCHANGE message. You can try this script. tested on XP - possibly works on win 2k /NT
| Code: |
REM Define highlighed green ?
#DEFINE COMMAND,SYSENV
#DEFINE FUNCTION,SYSENV
DIALOG CREATE,New Dialog,-1,0,314,105
DIALOG ADD,EDIT,EDIT1,31,14,125,19,
DIALOG ADD,EDIT,EDIT2,31,151,125,19,
DIALOG ADD,BUTTON,BUTTON1,66,94,107,24,Test,,Default
DIALOG ADD,TEXT,Name,17,14,,,Name
DIALOG ADD,TEXT,Value,17,152,,,Value
DIALOG SHOW
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:BUTTON1BUTTON
%N = @DLGTEXT(EDIT1)
%V = @DLGTEXT(EDIT2)
REM Create a new key %N specifying the system env variable with value %V
SYSENV WRITE,%N,%V
REM Check if the write was sucessful.
INFO @SYSENV(READ,%N)!
REM Delete the key %N
SYSENV DELETE,%N
REM Check if the deletion was sucessful.
INFO @SYSENV(READ,%N)!
GOTO EVLOOP
:CLOSE
EXIT
REM You can include the below sub in a seperate include file/DSU
:SYSENV
IF @EQUAL(%1,WRITE)
GOTO SYSENV_WRITE
ELSIF @EQUAL(%1,READ)
GOTO SYSENV_READ
ELSIF @EQUAL(%1,DELETE)
GOTO SYSENV_DELETE
ELSE
EXIT
END
:SYSENV_WRITE
LOADLIB USER32
IF @NOT(@NULL(%2))
REGISTRY WRITE,LOCAL,System\CurrentControlSet\Control\Session Manager\Environment,%2,%3
%A = @LIB(USER32,SendMessageA,int:,$FFFF,$1A,1,Environment)
END
FREELIB USER32
EXIT
:SYSENV_READ
%A = @REGREAD(LOCAL,System\CurrentControlSet\Control\Session Manager\Environment,%2)
EXIT %A
:SYSENV_DELETE
LOADLIB USER32
IF @NOT(@NULL(%2))
REGISTRY DELETE,LOCAL,System\CurrentControlSet\Control\Session Manager\Environment,%2
%A = @LIB(USER32,SendMessageA,int:,$FFFF,$1A,1,Environment)
END
FREELIB USER32
EXIT |
_________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Thu Nov 06, 2003 4:10 pm Post subject: |
|
|
CodeScript,
You are awsome!!! Your script works flawlessly on NT4sp6, w2k and XP embedded! Did I mention that your awsome?
Thanks everyone for your help!
Hooligan  _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Nov 06, 2003 9:00 pm Post subject: |
|
|
Nice! Thanks CodeScript even if I didn't ask for it, this might come in
handy some day.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|