|
-
Jul 14th, 2000, 10:22 PM
#1
Thread Starter
New Member
I'm trying to figure out how to access the environment variables. I'm working on an NT app, and I need to access some variables. I tried a piece of test code and it doesn't work. According to everything I read.. it should. Here are both variations.. any help would be appreciated
(VB 6.0 SP3, EE)
dim strSystemDrive as String
dim strSystemRoot as String
strSystemDrive = Environ(SYSTEMDRIVE)
strSystemRoot = Environ(SYSTEMROOT)
MsgBox strSystemDrive
MsgBox strSystemRoot
According to the online MSDN library online at Microsoft.. this should set strSystemDrive to C: and strSystemRoot to C:\WINNT.
I've also tried it like this:
dim strSystemDrive as String
dim strSystemRoot as String
strSystemDrive = Environ$(SYSTEMDRIVE)
strSystemRoot = Environ$(SYSTEMROOT)
MsgBox strSystemDrive
MsgBox strSystemRoot
In the first case, it complains that SYSTEMDRIVE is an undefined variable (option explicit is set). In the second case, they just appear to be empty. In both cases, if I type in (SYSTEMROOT) or (SYSTEMDRIVE) in any other case, VB converts it to upper case.
Anyone have any ideas?
Thanks,
David
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|