Solved

How to detect XP users document folder and appl data folder

Posted on 2003-10-30
2
141 Views
Last Modified: 2010-05-03
Hi,
In VB6 I'm trying to write some application data to my {app}/temp path, but that only works in WinXP if you are administrator. If you are a normal user you get the access denied message.

So, to work around this problem, I'm trying to detect in VB6 the folders...
{username} documents
{shared} documents for all users
...to add data created by the user and write my application-depended data.

Who can help me with this? In code or links to information about this.

With greetings, A.C.
0
Comment
Question by:410328
  • 2
2 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9650414
You could use environ function to know it

This will show you all possible dta that you could get with that function:

Sub test()
Dim i As Integer, s As String

i = 1
Do
    s = Environ(i)
    i = i + 1
    Debug.Print s
Loop While s <> ""
End Sub
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 125 total points
ID: 9650433
One more thing, you could use number or string as index for environ function.

example of string index

msgbox environ("COMPUTERNAME")
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question