Solved

How to detect XP users document folder and appl data folder

Posted on 2003-10-30
2
144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 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