Jump to content
Sign in to follow this  
goss34

DriveMapAdd Problem!

Recommended Posts

goss34

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

Share this post


Link to post
Share on other sites
goss34

Can anyone help?

Share this post


Link to post
Share on other sites
GMK

Have you tried If FileExists(...) or Ping(...) before mapping?

Share this post


Link to post
Share on other sites
tlman12

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

Share this post


Link to post
Share on other sites
goss34

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

Share this post


Link to post
Share on other sites
tlman12

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.

Share this post


Link to post
Share on other sites
goss34

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.

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  

×