Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to detect XP users document folder and appl data folder

Posted on 2003-10-30
2
Medium Priority
?
147 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 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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 …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses

773 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