Archive: How to detect letter of HD where $PROGRAMFILES is?


How to detect letter of HD where $PROGRAMFILES is?
  in my PC i have $PROGRAMFILES in "D:\Program Files". I need to put the letter of default Hard Drive(where $PROGRAMFILES is) to the variable..any idea? tnx


Use StrCpy to copy the first character.


Like:


StrCpy $0 $PROGRAMFILES "" 1 

>
Will return the drive letter used by $PROGRAMFILES in $0.

Doesn't work for me

but the code below does


StrCpy $0 $PROGRAMFILES 1 0 

>

tnx