goss34 Posted July 18, 2011 Posted July 18, 2011 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
Zedna Posted July 18, 2011 Posted July 18, 2011 Can anyone help?Don't bump your topics in 24 hours! Resources UDF ResourcesEx UDF AutoIt Forum Search
GMK Posted July 18, 2011 Posted July 18, 2011 Have you tried If FileExists(...) or Ping(...) before mapping?
Zedna Posted July 18, 2011 Posted July 18, 2011 test if device is already assigned by DriveMapGet (fast) Here my older example Resources UDF ResourcesEx UDF AutoIt Forum Search
tlman12 Posted July 18, 2011 Posted July 18, 2011 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.CheersDanwhat 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
goss34 Posted July 19, 2011 Author Posted July 19, 2011 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
tlman12 Posted July 19, 2011 Posted July 19, 2011 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,Danthe 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.
goss34 Posted July 19, 2011 Author Posted July 19, 2011 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now