Jump to content

error message suppression with @error tag


Recommended Posts

Hi there,

I'm learning a lot about autoit, but I'm getting weird errors when I run my script in a test environment. From what I can see in the helpfile I can suppress msgbox popups using the @error flag.

What I'm not sure about is the proper syntax I'm supposed to be using. I have a couple of drive mappings that map network drives when the script starts. My code is below:
 

func main()

        MapDrives()
        MapAdditionalDrives()
        
EndFunc

What I want to do is add an exit loop if the @error flag is set so that the script is killed silently if an error is thrown ( say for instance if a user profile doesn't have a home drive)

I figure that the code below will work, but I'm not sure if I have to create an if, else statement

If @error Then Exit

Would someone be able to help me figure out the proper syntax for this?

Link to comment
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
 Share

  • Recently Browsing   0 members

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