Looking adapt the follow code to work with XP and Vista
(currently works for XP)
vb Code:
Private Function GetMyVideosFolder() As String ' Get the path to the user's "My Videos" folder, creating it if it doesn't ' already exist (issue: may create an extra English "My Videos" folder in ' addition to the non-English one on localized Windows versions) Dim myDocs As String, sPath As String Dim IDL As ITEMIDLIST If SHGetSpecialFolderLocation(Me.hWnd, CSIDL_DOCUMENTS, IDL) = 0 Then sPath = Space(MAX_PATH) If SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal sPath) Then myDocs = Left(sPath, InStr(sPath, vbNullChar) - 1) & "" End If End If ' Get the path to "My Documents" If Dir(myDocs & "\My Videos", vbDirectory) = "" Then _ MkDir myDocs & "\My Videos" ' If "My Videos" doesn't exist in "My Documents", create it GetMyVideosFolder = myDocs & "\My Videos" End Function
Vista uses "Users" where XP uses "Documents and Settings"
I even tried to make a folder in root called Documents and Settigs, but Vista will not allow this name used.
Thanx




Reply With Quote