I’m writing a .bat
code that copies a .lnk
file to the Desktop, it is meant to be used locally in my company, but my problem is that, some computers we have, have only the disk C: and others we move the folders (desktop, documents, …) to D:UsersUser
creating this difference of configuraion, is there a way that I can know if the computer has this change and then redirect the .lnk
file to the right desktop?
I tried using %USERPROFILE%
but it only returned C:UsersUser
even if the primary files were located in D:UsersUser
, and I can’t check this by checking if the folder Desktop exists in C: or D:, because in some computers it exists in both (it happens because some apps send shortcuts to the Desktop), even though only one is shown as the principal user screen. Is there some variable windows has that detect this change?
Obs: the user folders are moved one by one by changing the first letter in the local tab of the properties of the folder.