Jump to content

SHGetKnownFolderPath Function ? How to ...


Recommended Posts

Hi guys !

I am trying to find the location of the users Desktop folder in Windows Vista. Querying the registry like in Windows XP does not work anymore. In XP I used this:

FOR /F "TOKENS=3 DELIMS=	" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Desktop') do set DESKTOP=%%i

Now the registry value is still there but it still does not work. Also, the registry contained a value that said

"Do not use these Registry values, use SHGetKnownFolderPath or SHGetFolderPath instead."

So I tried to look up this function on MSDN but since I am no programmer I am not able to use that to my satisfaction in a cmd or vbs. Thats the link:

Function

Can anyone help me out by explaining how I could use this function from inside a cmd ?

Thanks a lot !

Alex

Link to comment
Share on other sites


Hi again,

well, I did not find out how to use that function yet but I managed to find out the reason why the mentioned code did not work. The DELIM in Windows XP was a <TAB> key, in Vista it has to be a <SPACE> Key.

Does anyone know how to change special user folders like Documents, Music, Videos etc. to another path using a cmd or vbs in the same way as doing it manually in Explorer (if you do it in explorer you are being asked if you want to move the files over to the new place, then the old folder is deleted and the new one is created)

Thanks,

Alex

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...