jp10558 Posted May 29, 2013 Share Posted May 29, 2013 I have a samba server and while net use works to map a drive with credentials, with my Autoit script using DriveMapAdd I only get an error, specifically Undefined / Other error. Windows API, where @extended is set to 0. I'm really running out of ideas, this used to work, but I'm not sure what the interaction issue may be. The big change was to a RHEL HA clustered samba service. I've tried everything I can find from Windows and Linux, and it seems to work with native tools at a logged in user at the command line. But if I then, with the same user, run a compiled autoit script to map the drive, it fails. It even fails if I do a RunWait("cmd /c net use X: servershare password /user:userName", "", @SW_HIDE) ... note, if I do net use X: servershare password /user:userName at the command line in the same session, it works. I'm prefacing my attempts to map a drive with a DriveMapDel("x:") to avoid trying to map 2 times to the same drive letter... Any ideas? Link to comment Share on other sites More sharing options...
Artisan Posted May 29, 2013 Share Posted May 29, 2013 (edited) I'm not in an environment where I can play with network drives/printers, but I have a few questions for you: 1 - Is DriveMapDel a blocking function? Maybe it's returning too soon? 2 - Try your script with DriveMapDel commented out. If it works, you can try using DriveMapGet to check for a mapped drive before trying to delete it. Edited May 29, 2013 by Artisan Link to comment Share on other sites More sharing options...
jp10558 Posted May 29, 2013 Author Share Posted May 29, 2013 I actually was trying without the DriveMapDel initially and it was failing in the same way, so I added it in to clear out one of the potential causes I was aware of. Link to comment Share on other sites More sharing options...
jp10558 Posted June 4, 2013 Author Share Posted June 4, 2013 Anyone? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 4, 2013 Share Posted June 4, 2013 Why does the title say DriveMapAdd, but you're using "net use"? Which one are you actually having a problem with? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
jdelaney Posted June 4, 2013 Share Posted June 4, 2013 (edited) I've always had problems with mappings, and found the only way to work with them consistently, is to kill ALL mappings, and then add those that you need back in (if possible). Net Use * /Delete /YES Else, it's way to easy to get errors, like attempting to map 2 users to one share (ex: 2 drives), having the share present, but not active-failing on overwrite. Edited June 4, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
KaFu Posted June 4, 2013 Share Posted June 4, 2013 Sounds like an UAC issue to me.http://support.microsoft.com/kb/937624/en-us OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
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