Jump to content

Recommended Posts

Posted

Hi,

When I open a file dialog and select any file then the script cant open the temp.txt file.

If I choose cancel in the file dialog the script will open the temp.txt file.

Why is that?

//Johan

$message = "Select new driver file"

$var2 = FileOpenDialog($message, "C:\Windows\system32\drivers\", "All (*.sys)")

$file = FileOpen("temp.txt", 0)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

Posted

If I choose cancel in the file dialog the script will open the temp.txt file.

Why is that?

Adding If @error Then Exit after the FileOpenDialog() line will terminate the script if the user clicks Cancel.
Posted

Why is that?

That's O.K. See help file of FileOpenDialog().

@WorkingDir is changed on successfull return.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...