| | |
Userprofile
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2006
Posts: 23
Reputation:
Solved Threads: 0
I have a VB6 app that uses the Environ("userprofile") command to determine the location of the My Documents folder for the currently logged in user.
This has been working fine for ages with no problems. One particular client has had the user directory redirected to a network location so that he can back up all the user data. The problem I face is the Environ("userprofile") still returns the local C Drive location for the user and not the mapped network location.
How can I determine where the real user profile has been mapped to ? Is it a registry entry that can be read ?
This has been working fine for ages with no problems. One particular client has had the user directory redirected to a network location so that he can back up all the user data. The problem I face is the Environ("userprofile") still returns the local C Drive location for the user and not the mapped network location.
How can I determine where the real user profile has been mapped to ? Is it a registry entry that can be read ?
Hi,
Declare this API at the top :
to Get the path :
Regards
Veena
Declare this API at the top :
vb Syntax (Toggle Plain Text)
Private Declare Function SHGetFolderPath Lib "shfolder.dll" _ Alias "SHGetFolderPathA" _ (ByVal hwndOwner As Long, _ ByVal nFolder As Long, _ ByVal hToken As Long, _ ByVal dwReserved As Long, _ ByVal lpszPath As String) As Long
to Get the path :
vb Syntax (Toggle Plain Text)
Dim MyPath As String MyPath = Space(260) Call SHGetFolderPath(Me.hWnd, 0, -1, &HC, MyPath) MsgBox MyPath
Regards
Veena
•
•
Join Date: Jun 2009
Posts: 2
Reputation:
Solved Threads: 0
I've been trying to get the local dynamic user path to work but it doesn't seem to be.
John, what is your original code? Here is what I have but it isn't finding the file. I am using a checkbox and that feature is working but when I have it checked to use the path, it cannot find the file in that path (i.e. default.rdp). I have even tried strPath = Environ("%userprofile%\MyDocu~1") and strPath = Environ("%userprofile%\My Documents")
===> Code <===
John, what is your original code? Here is what I have but it isn't finding the file. I am using a checkbox and that feature is working but when I have it checked to use the path, it cannot find the file in that path (i.e. default.rdp). I have even tried strPath = Environ("%userprofile%\MyDocu~1") and strPath = Environ("%userprofile%\My Documents")
===> Code <===
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
strPath = Environ("%userprofile%" & "My Documents") If RDPConsole.Checked = True Then strRemoteConnect = ("mstsc /edit " & strPath & "default.rdp /v:") & IPBox1.Text Else strRemoteConnect = ("mstsc /v:") & IPBox1.Text End If Shell(strRemoteConnect, vbNormalNoFocus)
Last edited by Tekmaven; Jun 7th, 2009 at 10:00 pm. Reason: Code Tags
![]() |
Similar Threads
- Cannot connect to Internet after running troubleshooting software (Viruses, Spyware and other Nasties)
- VB Script Variables (Visual Basic 4 / 5 / 6)
- Aurora, DrPmon, MHTMLRedir problems (Viruses, Spyware and other Nasties)
- intel32.exe and psguard (Viruses, Spyware and other Nasties)
- datadx.dll (Viruses, Spyware and other Nasties)
- this compagny change my background (Viruses, Spyware and other Nasties)
- Registry question (Windows Software)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- clearing history (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Visual Basic
- Next Thread: How to import Xml file into a table in MS-ACCESS database using Visual Basic 6.0?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





