Achilles Posted July 24, 2008 Share Posted July 24, 2008 Hello, I'm creating a media player and wanted a way to get the music dir of the user... I think I've got it figured out by I don't have XP to check.. Please check: $name = _GetMusicDir() Msgbox(0, '', $name) Func _GetMusicDir() If @OSVersion = 'WIN_VISTA' then Return @UserProfileDir & '\Music' Else Return @MyDocumentsDir & '\My Music' EndIf EndFunc My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Decker87 Posted July 24, 2008 Share Posted July 24, 2008 It worked for me on XP. I have my music at the default location. Link to comment Share on other sites More sharing options...
BrettF Posted July 24, 2008 Share Posted July 24, 2008 All good here.Wouldn't the location be in the registry somewhere?I found these in the registry...HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Foldershttp://www.kellys-korner-xp.com/xp_shell_folders.htmNot sure if there's anything else muttley Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Achilles Posted July 24, 2008 Author Share Posted July 24, 2008 Thanks for that Bert, I hadn't thought of the registry. Please test this now, it works on Vista: $name = _GetMusicDir() Msgbox(0, '', $name) Func _GetMusicDir() ;~ If @OSVersion = 'WIN_VISTA' then ;~ Return @UserProfileDir & '\Music' ;~ Else ;~ Return @MyDocumentsDir & '\My Music' ;~ EndIf Return RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'My Music') EndFunc My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
BrettF Posted July 24, 2008 Share Posted July 24, 2008 Thanks for that Bert, I hadn't thought of the registry. Please test this now, it works on Vista: $name = _GetMusicDir() Msgbox(0, '', $name) Func _GetMusicDir() ;~ If @OSVersion = 'WIN_VISTA' then ;~ Return @UserProfileDir & '\Music' ;~ Else ;~ Return @MyDocumentsDir & '\My Music' ;~ EndIf Return RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'My Music') EndFuncXP Pro SP2 all good... muttley Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 24, 2008 Share Posted July 24, 2008 XP Pro SP2 all good... Swe XP Home SP3 also good muttley (but the first one would never have worked since "My Music" is translated on local versions) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Achilles Posted July 24, 2008 Author Share Posted July 24, 2008 Alright, thanks for your help in clarifying that. I'll go with the regread... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Backnor Posted July 24, 2008 Share Posted July 24, 2008 works on Vista home ult Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now