Sign in to follow this  
Followers 0
alucard

variablre problem

2 posts in this topic

#1 ·  Posted (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 by alucard

Share this post


Link to post
Share on other sites



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

<{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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0