Environment Variables

Discussion in 'Questions (Windows Mobile)' started by Zenerdiode, May 22, 2008.

  1. Zenerdiode

    Zenerdiode Active Member Licensed User

    In the desktop build, I'm trying to use the likes of %USERPROFILE% and its not working. I know with those environment variables you can find out the username (as in user-id), but there's a persons full name that I'd prefer to grab if anyone can help. Is it a registry call?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The door library comes to the rescue:
    obj is an Object.
    Code:
    Sub App_Start
        Form1.Show
        obj.New1(
    false)
        obj.CreateNew(
    "System.Environment")
        fullPath = GetPath(
    "%USERPROFILE%")
        
    Msgbox(fullPath)
    End Sub

    Sub GetPath (env)
        
    Return obj.RunMethod2("ExpandEnvironmentVariables",env,"System.String")
    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice