Jump to content

DriveMapAdd Problem!


Recommended Posts

Hi All,

I have written a script that will run as a user and map several drives. This works apart from 2 of the drives will not map due to "undefined/other error".

The problem is because the folders its trying to map to does not exist so i expect the error (although i would expect error 5 if anything??). My problem is before the error is generated it takes around 60 seconds to fail before showing the error message!

Any ideas as to how to make this fail quicker? If at all possible.

Cheers

Dan

Link to comment
Share on other sites

Hi All,

I have written a script that will run as a user and map several drives. This works apart from 2 of the drives will not map due to "undefined/other error".

The problem is because the folders its trying to map to does not exist so i expect the error (although i would expect error 5 if anything??). My problem is before the error is generated it takes around 60 seconds to fail before showing the error message!

Any ideas as to how to make this fail quicker? If at all possible.

Cheers

Dan

what is the windows api error it is returning?

after drivemapadd do an @extended and post that number. that would help determine exactly what is causing the issue.

or compare it to this list to see whats going on. http://www.hiteksoftware.com/knowledge/articles/049.htm

Link to comment
Share on other sites

Morning Guys,

Sorry for the bump.

The extended error is : 3 The system cannot find the path specified.

Which i would of expected to see but why does it take so long to fail? (This is whats causing the problem)

Thank you,

Dan

Link to comment
Share on other sites

Morning Guys,

Sorry for the bump.

The extended error is : 3 The system cannot find the path specified.

Which i would of expected to see but why does it take so long to fail? (This is whats causing the problem)

Thank you,

Dan

the best way to do that then would be GMK's suggestion of If FileExists("PathtoFolder") then DriveMapAdd(...)

it don't have to point to a file a folder will do as well.

Link to comment
Share on other sites

the best way to do that then would be GMK's suggestion of If FileExists("PathtoFolder") then DriveMapAdd(...)

it don't have to point to a file a folder will do as well.

Perfect, it seems i needed that stating twice before i twigged to what you guys meant!

All working lovely now, thank you.

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