 |

08-17-2004, 05:14 PM
|
|
Newcomer
|
|
Join Date: Aug 2004
Posts: 10
|
|
|
Just a quick question: Does Environ() work on all OS's? Also, does it require any specific dll's or ocx's that non-VB users might not have?
|
|

08-18-2004, 07:05 AM
|
 |
Senior Contributor
|
|
Join Date: Jul 2003
Location: Barcelona (SPAIN)
Posts: 1,054
|
|
|
I think so.
About the libraries... if you're gonna distribute some program I recommend you to make an installer. This way you'll be sure it'll work in every computer.
|
__________________
01000011011010000110000101110010011011000110100101100101
~ En mi vida sólo hay dos días que no me importan: ayer y mañana ~
|

08-18-2004, 10:20 AM
|
 |
Ultimate Contributor
* Expert *
|
|
Join Date: Jun 2003
Location: New York, NY
Posts: 1,929
|
|
Quote:
|
Originally Posted by cRazEYgUy
Just a quick question: Does Environ() work on all OS's? Also, does it require any specific dll's or ocx's that non-VB users might not have?
|
I believe that the Environ() functoin will work on any Win32 OS, however, not every OS will have the same environment variables, so you shouldn't rely on "standard" envirnoment variables.
|
__________________
"Fortunately, I live in the United States of America, where we are gradually coming to understand that nothing we do is ever our fault, especially if it is really stupid." - Dave Barry
|

08-18-2004, 10:22 AM
|
 |
Google Hound
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
|
|
Environ does not work on Win 9x platforms; only on NT class machines.
(as was recently discussed here)
|
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
|

08-18-2004, 11:33 AM
|
 |
Senior Contributor
|
|
Join Date: Jul 2003
Location: Barcelona (SPAIN)
Posts: 1,054
|
|
Quote:
|
Originally Posted by loquin
Environ does not work on Win 9x platforms; only on NT class machines.
(as was recently discussed here)
|
Well, I think paths as Environ("USERPROFILE"), Environ("ALLUSERSPROFILE"), Environ("APPDATA"), etc... don't work under Win9x beacuse THESE are from NT. But the rest Environ("HOMEDRIVE") must work on every Windows... I guess...
|
__________________
01000011011010000110000101110010011011000110100101100101
~ En mi vida sólo hay dos días que no me importan: ayer y mañana ~
|

08-18-2004, 11:58 AM
|
|
Retired Contributor
|
|
Join Date: Mar 2002
Posts: 1,829
|
|
Quote:
|
Originally Posted by cRazEYgUy
Just a quick question: Does Environ() work on all OS's? Also, does it require any specific dll's or ocx's that non-VB users might not have?
|
You lost me on the title of this tread man... What is the meaning of it?
Code:
If Environ("Tread_Title") <> ls_ThreadDiscussion Then
MsgBox "So tell me exactly what is is I SHOULD know..."
End If

|
|

08-18-2004, 12:09 PM
|
 |
Google Hound
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
|
|
Quote:
|
Originally Posted by charlie
Well, I think paths as Environ("USERPROFILE"), Environ("ALLUSERSPROFILE"), Environ("APPDATA"), etc... don't work under Win9x beacuse THESE are from NT. But the rest Environ("HOMEDRIVE") must work on every Windows... I guess...
|
My Bad. Environ does work on win9x platforms, however, while my win2K box has some 38 items, a neighbors win98 box had but 15, and of these, only 5 had the same name as on win2K. These 5 were Tmp, Temp, COMSPEC, windir, and PATH.
|
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
Last edited by loquin; 08-18-2004 at 12:15 PM.
|

08-18-2004, 12:25 PM
|
|
Retired Contributor
|
|
Join Date: Mar 2002
Posts: 1,829
|
|
|
Environ() only produces 28 items on my 2kbox.
I have an exe on my desktop I use one in a while for quick reference.
|
|

08-18-2004, 02:17 PM
|
 |
Ultimate Contributor
* Expert *
|
|
Join Date: Jun 2003
Location: New York, NY
Posts: 1,929
|
|
Quote:
|
Originally Posted by loquin
My Bad. Environ does work on win9x platforms, however, while my win2K box has some 38 items, a neighbors win98 box had but 15, and of these, only 5 had the same name as on win2K. These 5 were Tmp, Temp, COMSPEC, windir, and PATH.
|
Correct, both OSes have environmental variables. However, WindowsNT generates several of its own (such as HOMEPATH, etc), where Windows 9x (which is really a bundled MS-Win v4.x + MS-DOS v7.x) doesn't have any of it's own variables, so it relies on the under-lying DOS to provide variables. And since DOS doesn't use winNT variables such as HOMEPATH, NUMBER_OF_PROCESSORS, etc, then it doesn't provide these to the GUI (windows 4.x)
The point is still the same:
Yes, the Environ() function will return whatever environmental variables your systems has. But don't rely on a "standard" variable to be there, because not all OSes use/have the same variables.
Quote:
|
Originally Posted by Agent707
I have an exe on my desktop I use one in a while for quick reference.
|
nice.
Other ways to view the environment:
From a command prompt: Type SET
From the GUI: My Computer, Properties, Advanced tab, Environment Variables button
|
__________________
"Fortunately, I live in the United States of America, where we are gradually coming to understand that nothing we do is ever our fault, especially if it is really stupid." - Dave Barry
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|