DOS environment variables 
Author Message
 DOS environment variables

Can anyone tell me how to set DOS environment variables from Clarion 5.5
program?  I want to set UserName and UserID from within the program.  I've
tried RUN(command.com /c Set UserName=AnyName').  It doesn't report an error
but it doesn't work.  Is may syntax wrong?  Is there another way to do this?

Thanks to anyone offering a suggestion.

Jill Kunes



Fri, 21 Jan 2005 23:20:55 GMT  
 DOS environment variables
On Thu, 18 Jul 2002 13:51:28 -0500, "Jill Kunes"

Quote:

>Can anyone tell me how to set DOS environment variables from Clarion 5.5
>program?  I want to set UserName and UserID from within the program.  I've
>tried RUN(command.com /c Set UserName=AnyName').  It doesn't report an error
>but it doesn't work.  Is may syntax wrong?  Is there another way to do this?

Actually, it does work.  The RUN command opens a DOS prompt and sets
the environment variable within that DOS prompt only.  When the DOS
prompt closes, which happens immediately, the environment variable is
lost.  Each DOS prompt has it's own local copy of the environment
variables.

To set an environment variable so that Windows sees it, you either
have to set it prior to Windows loading (in AUTOEXEC.BAT) or you need
to use WINSET, a small program that was supplied on the Win95/98
CD-ROM.  I don't know if it is also included in any of the newer
versions of Windows, as I don't have a copy of those.

Jason



Fri, 21 Jan 2005 23:20:56 GMT  
 DOS environment variables
Each process in Windows inherits a copy of the primary environment
block. There is a Class in my book CLARION COMPANION that will set
local environment variables from within your app.

Quote:

> Can anyone tell me how to set DOS environment variables from Clarion 5.5
> program?  I want to set UserName and UserID from within the program.  I've
> tried RUN(command.com /c Set UserName=AnyName').  It doesn't report an error
> but it doesn't work.  Is may syntax wrong?  Is there another way to do this?

> Thanks to anyone offering a suggestion.

> Jill Kunes


--
 Randy Goodhew
 ---[ eQ ]---


Fri, 21 Jan 2005 23:20:58 GMT  
 DOS environment variables
How about using an INI file for this.

Jeff Hojka


Quote:
> Can anyone tell me how to set DOS environment variables from Clarion 5.5
> program?  I want to set UserName and UserID from within the program.  I've
> tried RUN(command.com /c Set UserName=AnyName').  It doesn't report an
error
> but it doesn't work.  Is may syntax wrong?  Is there another way to do
this?

> Thanks to anyone offering a suggestion.

> Jill Kunes




Fri, 21 Jan 2005 23:21:00 GMT  
 DOS environment variables
How about

SetEnvironment(long,long,USHORT),Pascal,short
and
GetEnvironment(long,long,USHORT),pascal,short

Skip


Quote:
> Can anyone tell me how to set DOS environment variables from Clarion 5.5
> program?  I want to set UserName and UserID from within the program.  I've
> tried RUN(command.com /c Set UserName=AnyName').  It doesn't report an
error
> but it doesn't work.  Is may syntax wrong?  Is there another way to do
this?

> Thanks to anyone offering a suggestion.

> Jill Kunes




Fri, 21 Jan 2005 23:21:05 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Reading DOS environment variables from c4b

2. CW20 and DOS environment variables

3. getting (DOS) environment variables

4. CW + Dos environment variables

5. Dos environment variables

6. DOS Environment Variables

7. Accessing DOS Environment Variables.

8. Referencing DOS Environment Variables in Fortran

9. Accessing DOS Environment Variables

10. Using dos/windows environment variables in gawk script

11. DOS Clipper environment variable

12. DOS SET command or set environment variable from Rexx

 

 
Powered by phpBB® Forum Software