Search the Community
Showing results for tags 'DriveMapAdd'.
-
Hello I want to conect to a Network with DriveMapAdd. This worked just fine but when you restart the Computer the Mapped drive is gone. So i used the persistent mapping flag and that seemed to work, too. However when the Computer is restarted I cant connect to the Network because it doesnt remember the Username and password I ave it the first time. How do I fix this? My Code:Func setdrivem() DriveMapAdd("M:", GUICtrlRead($driveM),1, GUICtrlRead($netzuser),GUICtrlRead($netzpassword) ) EndFunc $netzuser and $netzpassword are set earlier in the gui and it works right after executing the script but i want it to stay connected
-
Hello, I've run in to a problem with DriveMapAdd sometimes failing with the Error=1 Extended=0 and the drive not mapping. So to give the user a better error description i found the command _WinAPI_FormatMessage which should give me wonderfull Windows messages, but it only returns a single letter. I found a wouldbe working code sniplet i could change to fit my needs, how ever it doesn't work for me as it is and even when i change it so that it doesn't produce errors it still doesn't work. It seems to have worked for the guy right here: '?do=embed' frameborder='0' data-embedContent>> Unedited: #include <WinAPI.au3> $n = 53; Error code MsgBox(64, "Test", _WinAPI_GetErrorMessage($n)) Func _WinAPI_GetErrorMessage($iErrorNum) Local $tText $tText = DllStructCreate("char Text[4096]") _WinAPI_FormatMessage($__WINAPCONSTANT_FORMAT_MESSAGE_FROM_SYSTEM, 0, $iErrorNum, 0, DllStructGetPtr($tText), 4096, 0) Return DllStructGetData($tText, "Text") EndFunc ;==>_WinAPI_GetErrorMessage My attempt: #include <WinAPI.au3> Local Const $FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000 $n = 53; Error code MsgBox(64, "Test", _WinAPI_GetErrorMessage($n)) Func _WinAPI_GetErrorMessage($iErrorNum) Local $tText $tText = DllStructCreate("char Text[4096]") $ptext = DllStructGetPtr($tText) _WinAPI_FormatMessage($FORMAT_MESSAGE_FROM_SYSTEM, 0, $iErrorNum, 0, $ptext, 4096, 0) Return DllStructGetData($tText, "Text") EndFunc ;==>_WinAPI_GetErrorMessage Any help would be greatly apprisiated
- 2 replies
-
- @extended
- error handling
-
(and 1 more)
Tagged with: