ViciousXUSMC Posted July 29, 2014 Posted July 29, 2014 I am trying to use the DriveMapAdd function and its just not working correctly for me. I have dumbed down my script to be as simple as possible for testing purposes. Currently: DriveMapAdd("W:", "\\vtrendserver\ofcscan") I am running this on windows 7 x64 on a Domain Logged in as a domain user that has permission for this location already (as part of testing my end goal is to map this location for a local account and get prompted for domain credentials to gain access) The script is not failing, it runs but the drive is not mapped. The very interesting part is that during my troubleshooting when I went to go map the drive manually via the "Map network drive" from My Computer the W: is showing that its mapped in the drop down box and it made me verify I wanted to overwrite the current connection with my new one before it would proceed. If I do map manually (Via cmd with Net Use or via the "Map network drive" dialog the Drive letter shows in my computer and I have access. With only the AutoIt script even though I have this "invisible" mapped drive that does not show in My Computer I can not access the location even if typing in the location manually with the supposed drive letter. So it seems that the function just is not working properly and not sure if this is a known issue or a limitation of it based on my environment. Screenshot attached showing the "Invisible" mapped drive left from AutoIt before I map it via other means.
Moderators JLogan3o13 Posted July 29, 2014 Moderators Posted July 29, 2014 What version of AutoIt are you using, first off. Also, what do you get on error checking when running the DriveMapAdd command? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
computergroove Posted July 29, 2014 Posted July 29, 2014 (edited) Are you opposed to using the windows comspec? Run(@ComSpec "net use Y: \\Server\C /User:acme /Pass:123") Edited July 29, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Moderators JLogan3o13 Posted July 29, 2014 Moderators Posted July 29, 2014 (edited) While a workaround is always great, there is merit to using a native AutoIt function if it exists (otherwise why not suggest people go back to using batch files for everything ). I would think rather than abandoning DriveMapAdd as a solution, we would be better served helping the OP figure out why it is not operating as he expects. Edited July 29, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Developers Jos Posted July 29, 2014 Developers Posted July 29, 2014 Are you opposed to using the windows comspec? Run(@ComSpec "net use Y: \\Server\C /User:acme /Pass:123") Doubt that works without an & and a /c in there . SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
computergroove Posted July 29, 2014 Posted July 29, 2014 (edited) Doubt that works without an & and a /c in there . Run(@ComSpec & "/c" & "net use Y: \\Server\C /User:acme /Pass:123") Sorry about that. I cannot find really solid documentation on the @ComSpec anywhere. Edited July 29, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Developers Jos Posted July 29, 2014 Developers Posted July 29, 2014 Run(@ComSpec & "/c" & "net use Y: \\Server\C /User:acme /Pass:123") Sorry about that. I cannot find really solid documentation on the @ComSpec anywhere. Nearly correct .... just one mistake there left. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
ViciousXUSMC Posted July 29, 2014 Author Posted July 29, 2014 Lol, I use @ComSpec for a few things. Totally should have gone that as my temporary work around rather than calling to a bat file but forgot all about it. I am using the newest version 3.3.12.0 and I have made sure my .exe is being run as Administrator.
computergroove Posted July 29, 2014 Posted July 29, 2014 (edited) Run(@ComSpec & "/c net use Y: \\Server\C /User:acme /Pass:123") I am trying to piece it together from this -> http://www.autoitscript.com/wiki/Snippets_%28_CMD_%29 but I am not 100% sure. Edited July 29, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Developers Jos Posted July 29, 2014 Developers Posted July 29, 2014 Run(@ComSpec & "/c net use Y: \\Server\C /User:acme /Pass:123") I am trying to piece it together from this -> http://www.autoitscript.com/wiki/Snippets_%28_CMD_%29 but I am not 100% sure. Still one error in there .... sorry for being a pain but think it would be nice when you propose stuff that works. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
ViciousXUSMC Posted July 29, 2014 Author Posted July 29, 2014 What version of AutoIt are you using, first off. Also, what do you get on error checking when running the DriveMapAdd command? No Error it passes with no @Error unless I run it more than once then I get Error 3 = Already Mapped
Moderators JLogan3o13 Posted July 29, 2014 Moderators Posted July 29, 2014 (edited) Lol, I use @ComSpec for a few things. Totally should have gone that as my temporary work around rather than calling to a bat file but forgot all about it. I am using the newest version 3.3.12.0 and I have made sure my .exe is being run as Administrator. How about the error return when you run DriveMapAdd? Edit: Missed your post while I was typing @computergroove, just a suggestion, maybe another thread to assist you in getting @Comspec working, rather than overtaking the OP in this one... Edited July 29, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
computergroove Posted July 29, 2014 Posted July 29, 2014 Run(@ComSpec & ' /c ' & "net use " & "Y: MYBOOKLIVEDUOPublic") Had to setup a network share on another computer and play with it a bit. This one worked. Again is there better documentation on this? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
Developers Jos Posted July 29, 2014 Developers Posted July 29, 2014 Run(@ComSpec & ' /c ' & "net use " & "Y: MYBOOKLIVEDUOPublic") Had to setup a network share on another computer and play with it a bit. This one worked. Again is there better documentation on this? Yes it does and I am regularly wondering why the hell many of you do this string concatenation with @comspec command lines. Just simply do: Run(@ComSpec & ' /c net use Y: \\MYBOOKLIVEDUO\Public') So now let's get back to the topic at hand which is DriveMapAdd() issues the OP is having. Thanks jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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