XOJO Shell C: variable

Hi Team!

I’m playing with shell over windows.
So i have a doubt, Which is the variable to access “C:” in Shell on Windows?

I n order to do a Shell.Execute(C:/MyApp/Test.exe)
Regards

Try using backslashes. “”, not “/”.

ok I got it. Just a silly answer. Nowadays normal people Install windows on “C” partition and not in “X” other partition, like in old times.

But what about if this happens? if exists a variable like SpecialFolder that points to Root partition, where Windows is installed?

I am not too good at special folders, but there seems to be one “system”. So - create a folderitem and set it to the system special folder. Then take the left 3 bytes of the absolutepath of that folderitem, and you should get the system drive - “C:” unless the user is nuts and has his system elsewhere, which is likely to cause all kinds of trouble for him.

Be aware that Windows 10 seems to require administrator rights to create anything in the system drive root folder, or to copy anything there.

You should be able to use the %SystemDrive% variable in the shell.

dim sh as new shell
sh.execute(“echo %SystemDrive%”)

Or if you need it in your code, use

dim s as string = System.EnvironmentVariable(“systemdrive”)

R3 when building for 64bit allows setting the manifest to request administrator permissions.