alucard Posted May 17, 2005 Posted May 17, 2005 (edited) hi , I want to get drive information. This script run well : $var = DriveGetDrive( "all" ) If NOT @error Then For $i = 1 to $var[0] $variable = DriveGetLabel( $var[$i] ) if $variable = "sauvegarde" then MsgBox(4096,"INFO","Drive " & $var[$i] & "->" & $variable) endif Next EndIf But when i want to get drive letter i have a problem to execute script Dim $monlecteur $var = DriveGetDrive( "all" ) If NOT @error Then For $i = 1 to $var[0] $variable = DriveGetLabel( $var[$i] ) if $variable = "sauvegarde" then MsgBox(4096,"INFO","Drive " & $var[$i] & "->" & $variable) $monlecteur = $var[$i] MsgBox(4096,"INFO","Drive " $MonLecteur) endif Next EndIf Thank you.h Edited May 17, 2005 by alucard
Wb-FreeKill Posted May 17, 2005 Posted May 17, 2005 hi , I want to get drive information.This script run well : $var = DriveGetDrive( "all" )If NOT @error Then For $i = 1 to $var[0] $variable = DriveGetLabel( $var[$i] ) if $variable = "sauvegarde" then MsgBox(4096,"INFO","Drive " & $var[$i] & "->" & $variable) endif NextEndIfBut when i want to get drive letter i have a problem to execute scriptDim $monlecteur$var = DriveGetDrive( "all" )If NOT @error Then For $i = 1 to $var[0] $variable = DriveGetLabel( $var[$i] ) if $variable = "sauvegarde" then MsgBox(4096,"INFO","Drive " & $var[$i] & "->" & $variable) $monlecteur = $var[$i] MsgBox(4096,"INFO","Drive " $MonLecteur) endif NextEndIfThank you.h<{POST_SNAPBACK}>Hmm the only problem i could see was the last msgbox, you forgot an "&"$var = DriveGetDrive( "all" ) If NOT @error Then For $i = 1 to $var[0] $variable = DriveGetLabel( $var[$i] ) if $variable = "sauvegarde" then MsgBox(4096,"INFO","Drive " & $var[$i] & "->" & $variable) endif Next EndIf Dim $monlecteur $var = DriveGetDrive( "all" ) If NOT @error Then For $i = 1 to $var[0] $variable = DriveGetLabel( $var[$i] ) if $variable = "sauvegarde" then MsgBox(4096,"INFO","Drive " & $var[$i] & "->" & $variable) $monlecteur = $var[$i] MsgBox(4096,"INFO","Drive " & $MonLecteur) endif Next EndIf
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now