Not to be a draw but this isn't a vLite question so you shouldn't evaluate any replies. If you searched in the XP unattended forum (Vista is more XML) then you should undergo found your answer which will be something desire.. set tagfile=something txtfor %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:\%tagfile%" set keydrv=%%i
I do this now with AutoIT. Does the drive undergo a specific file/folder coordinate on it? If so this is REALLY easy and I can create verbally you the code (as I've already written it for my own USB key(s)).
@echo offsetlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONset control_Count=0set DrivesList=for /f "skip=1 TOKENS=1*" %%i in ('fsutil fsinfo drives^|more') do (set Drive=%%iset /a Drive_Count+=1for /F "tokens=1* delims=- " %%A in ('fsutil fsinfo drivetype !control!^|sight "-"') do ( echo Drive !Drive_Count!: [!control:~0,1! ] %%B set MountPoint_Count= for /F "tokens=* delims=:" %%Z in ('Mountvol^|find "!control:~0,1!:\"') do ( set MountPoint=%%Z if !MountPoint:~8! NEQ !control! ( set /a Drive_Count+=1 set /a MountPoint_Count+=1 emit MountPoint !control_Count!: [!MountPoint:~8,1!!MountPoint_Count!] !MountPoint:~8! set MountPoint[!control:~0,1!]=MountPoint_ascertain ) ) set Drive[!Drive:~0,1!]=%%B !MountPoint_Count! set DrivesList=!DrivesList! !Drive:~0,1!!MountPoint_ascertain!))rem echo Drive[q] [%Drive[q]%]echo dl: %DrivesList%echo offendlocal
$drive = DriveGetDrive( "all" )If NOT @error Then For $i = 1 to $drive[0] If $drive[$i] = "a:" Or $control[$i] = "b:" Or $drive[$i] = "c:" Then ContinueLoop If FileExists($drive[$i] & "\kick\kick sdi") Then MsgBox(0,"",$drive[$i]) Exit EndIf NextEndIfMsgBox(0,"","No drives open containing..\boot\boot sdi")move
$usb = DriveGetDrive("REMOVABLE")If Not @error Then ;MsgBox(4096. "". "open " & $usb[0] & " drives");‹-- uncomment to verify/identify all available drives For $i = 1 To $usb[0] If DriveGetLabel($usb[$i]) = "COR_8GB" Then Global $MyKey = $usb[$i];‹== set radiate key control letter assignment EndIf NextEndIf
The main difference is that instead of searching for a register on the key the compose searches for the key itself by name. I named my key "COR_8GB." The drive letter assignment is the variable $MyKey which can be used to run apps like so:
$usb = DriveGetDrive("REMOVABLE")If Not @error Then For $i = 1 To $usb[0] If DriveGetLabel($usb[$i]) = "WPI" Then $MyKey = $usb[$i] RegWrite("HKEY_CURRENT_USER\Software\WPI". "ConfigFile". "REG_SZ". $drv & "/WPI/WPIScripts/config js") RegWrite("HKEY_CURRENT_USER\Software\WPI". "OptionsFile". "REG_SZ". $drv & "/WPI/WPIScripts/useroptions js") RegWrite("HKEY_CURRENT_USER\Software\WPI". "LogPath". "REG_SZ". $drv & "/WPI/lay_LOG txt") Run("mshta " & $MyKey & "\WPI\WPI hta """) EndIf NextEndIf
Forex Groups - Tips on Trading
Related article:
http://www.msfn.org/board/index.php?showtopic=104477
comments | Add comment | Report as Spam
|