Getting current logged in profile path when running app as admin

  • Thread starter Thread starter wingers
  • Start date Start date
W

wingers

Guest
Hi

In my app I used code such as examples below to get current logged on users profile path, documents folder etc

MsgBox(My.Computer.FileSystem.SpecialDirectories.MyDocuments)
MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile))

This works fine when app running as current user

BUT I need to run the app as administrator e.g. editing app.manifest and setting <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

This then means above commands pick up admin profile path rather than currently logged on users profile path

Anyway round this?


Thanks





Darren Rose

Continue reading...
 
Back
Top