Desktop Address

BlitzMax Forums/BlitzMax Beginners Area/Desktop Address

Hardcoal(Posted 2016) [#1]
Hi, How can I get the Desktop address?

Tnx


Henri(Posted 2016) [#2]
Hi,

I would suggest Brucey's 'Volumes.mod' for crossplatform support and as it uses the native API to retrieve folder paths, but just for fun you can try this:
OpenURL( getenv_("USERPROFILE") + "\Desktop")
I have only tested that in Win7.

-Henri


xlsior(Posted 2016) [#3]
OpenURL( getenv_("USERPROFILE") + "\Desktop")


Keep in mind that'll only works in English-language Windows, other languages use their local equivalent for 'desktop'. It'll be OK if you create a program for your own personal use, but if you intent to create something for an international audience it will fail on a LOT of computers.

The -right- way to get that info is through the Windows API -- like Brucey's volume.mod does.


Bobysait(Posted 2016) [#4]
"%UserProfile%\Desktop" should work with all languages (even with a French OS)
In non english OS, path are all accessible with english keys (and by the way, they are only translated for commun usage, while the real path names are in english)
-> C:\Users\bobysait\Desktop is the real path to my desktop, while this is what is written in the url bar "C:\Utilisateurs\bobysait\bureau" (but this is only for convinience, because the "Utilisateurs" folder does not exist on "C:", it's only translated from "Users")


Hardcoal(Posted 2016) [#5]
Ok tnx people.. very helpful. Ill do some tests.

Great community