Quote:
Originally Posted by sakila(playboy)
Can anyone tell me what's wrong this?
|
Work:
Red = you add
Green = delete
Code:
var
x, bit, i: Integer;
tp: Cardinal;
sd: string;
Begin
sd := ExpandConstant('{sd}');
Result := ExpandConstant('{pf}\');
x := GetLogicalDrives;
If x <> 0 Then
For i:= 1 To 64 Do
Begin
bit := x and 1;
If bit = 1 Then
Begin
tp := GetDriveType(PAnsiChar(Chr(64 + i) + ':'));
If tp = DRIVE_FIXED Then
If Chr(64 + i) <> Copy(sd, 1, 1) Then
Begin
Result := Chr(64 + i) + ':\Games\';
Break;
End;
End;
x := x shr 1;
End;
End;
End;