Jump to content

Recommended Posts

Posted (edited)

Hi I have an input box that collects a password and it works fine. But I would now like to add a message box if the Cancel button is clicked.

I have been tearing my hair out trying to get this to work, can anyone help ?

Thanks

Original Code

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")
                    
Run("truecrypt.exe /l " & $Found & "/m /a /q, 1, true /v encrypted.tc /p " & $passwd)

What I'm Trying

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
Else

; Continue script
Edited by brian873
Posted

Hi I have an input box that collects a password and it works fine. But I would now like to add a message box if the Cancel button is clicked.

I have been tearing my hair out trying to get this to work, can anyone help ?

Thanks

Original Code

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")
                    
Run("truecrypt.exe /l " & $Found & "/m /a /q, 1, true /v encrypted.tc /p " & $passwd)

What I'm Trying

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
Else

; Continue script
the cancel button return 2

$a = msgBox(1,"","Cancel")

if $a == 2 then msgBox(0,"","press cancel Button")

Posted

Thanks Guys for the quick response.

I managed to get it working with the following code.

Thanks again for the help

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
Else
    Run("truecrypt.exe /l " & $Found & "/m /a /q, 1, true /v encrypted.tc /p " & $passwd)                       EndIf

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
×
×
  • Create New...