Solved

How to detect XP users document folder and appl data folder

Posted on 2003-10-30
2
142 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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 …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

839 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