开发者

startup folder path for Current user and local machine

How do开发者_Go百科 i get the startup folder path for "Current user" and "All user" in VB.net?


Try

 Environment.GetEnvironmentVariable("ALLUSERSPROFILE")  'All Users Directory'
 Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) 'Current User Directory'

With the Environment.SpecialFolder enumeration you also have available a Startup and a CommonStartup enumeration. They map to the current user and the all users startup directory.


Im unclear about exatly what location you want ill give you a wey to get Environment Variables.

Private Function GetEnvironmentVariable(ByVal var As String) As String
    var = Environment.GetEnvironmentVariable(var)
    Return var
End Function

Then pass it the name of the Environment Variable you want. If you are going to add more to the paths like in Rudu's post, you should keep in mind that paths are different of different operating systems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜