Archive: getdrives and locate


getdrives and locate
hi all
i have a newbie question :rolleyes:
in post http://forums.winamp.com/showthread....hreadid=210817 there was this script by sreedhar_kumar for getting drive types and another script for serching files by predefined vars (filename/drive etc...)
if ${GetDrives} detects one of my drives as FDD, is there a way to use ${GetDrives} "FDD" and then use "locate" on the drive letter found without searching drive a:?

i'm trying to run a search on a mis-identified thumb-drive (which changes it's drive letter each time i disconnect it) and still skip searching the real floppy drive.

help would be appriciated.


Name "Test"
OutFile "Test.exe"

!include "FileFunc.nsh"
!insertmacro Locate
!insertmacro GetDrives

Section
StrCpy $R0 ''
${GetDrives} "FDD" "GetDrivesCallback"

StrCmp $R0 '' quit
MessageBox MB_OK '$R0'

quit:
SectionEnd

Function GetDrivesCallback
StrCmp $R9 "a:\" continue
${Locate} "$9" "/L=F /M=LocalMedicFiles.mdf /G=1" "LocateCallback"

continue:
Push $0
FunctionEnd

Function LocateCallback
StrCpy $R0 $R9
StrCpy $0 StopLocate

Push $0
FunctionEnd

thanks ALOT
saved me quite alot of messing around with external search using VBS and some registry flags
thanks again :up: