Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: [VB6] - Program Files Variable?
10-07-2007, 05:37 PM #1
- Join Date
- Jun 2006
- Thanked 0 Times in 0 Posts
[VB6] - Program Files Variable?
Is there a variable I can use in a string for Program Files?
10-08-2007, 12:25 AM #2
The %programfiles% variable at the DOS level will give you the program files directory. If your dealing with an x64 Windows Operating system you also want to look for an x86 Program Files directory.
Dim i as Integer Text1.Text = "" i = 1 While Environ$(i) <> "" Text1.Text = Text1.Text + Mid(Environ$(i), 1, InStr(1, Environ(i), "=") - 1) + vbNewLine i = i + 1 Wend
To actually assign an environment variable to a variable in your application you would use:Code:
dim strProgramFile as string strProgramFile = Environ(”ProgramFiles”)
-saige-HTML & CSS Forum Moderator
"If you don't know what you think you know, then what do you know."
R.I.P. Derrick Thomas #58
1/1/1967 - 2/8/2000