Solved

How to detect XP users document folder and appl data folder

Posted on 2003-10-30
2
139 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
Comment Utility
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
Comment Utility
One more thing, you could use number or string as index for environ function.

example of string index

msgbox environ("COMPUTERNAME")
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now