473,378 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Getting the user profile folder

Hi

I need to get the signature folder for the current folder such as;
"F:\Documents and Settings\Dave\Application Data\Microsoft\Signatures\"
except that instead of Dave I need the correct name for the current user, s
that my code works generically regardless of who is logged in. Is there a
way to do that?

Thanks

Regards
Jan 15 '06 #1
4 8391
On Sun, 15 Jan 2006 01:32:00 -0000, "John" <Jo**@nospam.infovis.co.uk> wrote:
Hi

I need to get the signature folder for the current folder such as;
"F:\Documents and Settings\Dave\Application Data\Microsoft\Signatures\"
except that instead of Dave I need the correct name for the current user, s
that my code works generically regardless of who is logged in. Is there a
way to do that?

Thanks

Regards


http://www.mvps.org/access/api/api0054.htm
Wayne Gillespie
Gosford NSW Australia
Jan 15 '06 #2
Wayne Gillespie <be*****@NOhotmailSPAM.com.au> wrote in
news:p8********************************@4ax.com:
On Sun, 15 Jan 2006 01:32:00 -0000, "John"
<Jo**@nospam.infovis.co.uk> wrote:
I need to get the signature folder for the current folder such as;
"F:\Documents and Settings\Dave\Application
Data\Microsoft\Signatures\" except that instead of Dave I need the
correct name for the current user, s that my code works
generically regardless of who is logged in. Is there a way to do
that?


http://www.mvps.org/access/api/api0054.htm


Er, what's wrong with this?

Environ("USERPROFILE")

Lots less code, it seems to me.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 15 '06 #3
Nothing.

Knowing how to get a handle to all the special folders is very useful
though.

--

Terry Kreft
"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@127.0.0. 1...
Wayne Gillespie <be*****@NOhotmailSPAM.com.au> wrote in
news:p8********************************@4ax.com:
On Sun, 15 Jan 2006 01:32:00 -0000, "John"
<Jo**@nospam.infovis.co.uk> wrote:
I need to get the signature folder for the current folder such as;
"F:\Documents and Settings\Dave\Application
Data\Microsoft\Signatures\" except that instead of Dave I need the
correct name for the current user, s that my code works
generically regardless of who is logged in. Is there a way to do
that?


http://www.mvps.org/access/api/api0054.htm


Er, what's wrong with this?

Environ("USERPROFILE")

Lots less code, it seems to me.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Jan 16 '06 #4
another way ... apropos to nothing

Option Explicit

' requires reference to shell32.dll

' the constants are just here for reference
' as intellisense doesn't show them

Private Const ssfALTSTARTUP As Byte = &H1D
Private Const ssfAPPDATA As Byte = &H1A
Private Const ssfBITBUCKET As Byte = &HA
Private Const ssfCOMMONALTSTARTUP As Byte = &H1E
Private Const ssfCOMMONAPPDATA As Byte = &H23
Private Const ssfCOMMONDESKTOPDIR As Byte = &H19
Private Const ssfCOMMONFAVORITES As Byte = &H1F
Private Const ssfCOMMONPROGRAMS As Byte = &H17
Private Const ssfCOMMONSTARTMENU As Byte = &H16
Private Const ssfCOMMONSTARTUP As Byte = &H18
Private Const ssfCONTROLS As Byte = &H3
Private Const ssfCOOKIES As Byte = &H21
Private Const ssfDESKTOP As Byte = &H0
Private Const ssfDESKTOPDIRECTORY As Byte = &H10
Private Const ssfDRIVES As Byte = &H11
Private Const ssfFAVORITES As Byte = &H6
Private Const ssfFONTS As Byte = &H14
Private Const ssfHISTORY As Byte = &H22
Private Const ssfINTERNETCACHE As Byte = &H20
Private Const ssfLOCALAPPDATA As Byte = &H1C
Private Const ssfMYPICTURES As Byte = &H27
Private Const ssfNETHOOD As Byte = &H13
Private Const ssfNETWORK As Byte = &H12
Private Const ssfPERSONAL As Byte = &H5
Private Const ssfPRINTERS As Byte = &H4
Private Const ssfPRINTHOOD As Byte = &H1B
Private Const ssfPROFILE As Byte = &H28
Private Const ssfPROGRAMFILES As Byte = &H26
Private Const ssfPROGRAMS As Byte = &H2
Private Const ssfRECENT As Byte = &H8
Private Const ssfSENDTO As Byte = &H9
Private Const ssfSTARTMENU As Byte = &HB
Private Const ssfSTARTUP As Byte = &H7
Private Const ssfSYSTEM As Byte = &H25
Private Const ssfTEMPLATES As Byte = &H15
Private Const ssfWINDOWS As Byte = &H24

Private Function GetASpecialFolder(ByVal SSF As Long) As String
Dim s As Shell
Dim f As Folder3
Set s = New Shell
Set f = s.NameSpace(SSF)
If Not f Is Nothing Then
GetASpecialFolder = String(260, vbNullChar)
With WizHook
.Key = 51488399
.FullPath f.Title, GetASpecialFolder
End With
End If
End Function

Sub test()
Debug.Print GetASpecialFolder(ssfBITBUCKET)
End Sub

Jan 16 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Pavils Jurjans | last post by:
Hallo, After installing the dot-NET framework on my PC, I see that a new user profile has been created. I wouldn't bother if that would be just a new 'user' created, but why the whole profile?...
1
by: \Rob\ | last post by:
Why does my ASPNET application create a IWAM_<machinename> user profile? Obviously it runs under the security context of this account but I'm not sure why it creates this profile. I am on a...
2
by: Iceken | last post by:
Hi, In my app I need to delete several user profiles inside the Documents and Settings folder. But everytime i try Directory.Delete(path) I get a IOException with "Access denied to path ..",...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
0
by: Bikram | last post by:
How to delete a user profile folder in asp.net using c#.
3
by: JJ | last post by:
Whats the best way to do this?: Users from different companies need to log into a web site. I want to add the users company name, address etc to their profile. However I want the company details...
4
by: Scott M. | last post by:
When profile data is stored in ASP .NET, where is the user data persisted? For how long is it persisted: is it session persisted or permanent (like a cookie)?
0
by: shaikhcons | last post by:
I am working on a program that will delete a user profile from server 2003, I can use delprof in a cmd but this is a very basic way to clear my server with old unwanted user profile. I am looking...
5
by: geoffreyfishing | last post by:
I have tried posting everywhere, but no one has given me an answer so far. I am willing to try everything short of a clean install of vista. My Problem: Some process has a locking handle on the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.