Opened 14 years ago
Closed 14 years ago
#2186 closed Bug (Fixed)
WinNet UDF - AddConnection Functions - Help File Issue
| Reported by: | MrMitchell | Owned by: | guinness |
|---|---|---|---|
| Milestone: | 3.3.9.5 | Component: | Documentation |
| Version: | 3.3.9.4 | Severity: | None |
| Keywords: | WinNet | Cc: |
Description
In the Help File, for the _WinNet_AddConnection, _WinNet_AddConnection2, _WinNet_AddConnection3 functions, for $sLocalName parameter the doc says "If 0, a connection to the network...without redirecting the local device."
I cannot get the function to work in this manner by passing a 0 as the $sLocalName parameter. The only way to get it to work is to pass either an empty string or the Null keyword. In 3.3.9.4 beta either works fine. In 3.3.8.1 current production, passing only an empty string works since Null keyword isn't supported yet. Either way both Help Files say pass a 0, so I believe the Help File should be updated - replacing 0 with Null and/or empty string.
This is very similar to issue #2132.
Here's code that doesn't work:
$sServer = '
server\'
$sShare = 'C$'
$sUsername = 'domain\user'
$sPassword = 'password'
$sServerShare = $sServer & $sShare
$result = _WinNet_AddConnection2(0, $sServerShare, $sUsername, $sPassword, 1)
If $result Then
ShellExecute("Connection created to ", $sServerShare)
Else
ConsoleWrite("Unable to connect to " & $sServerShare & @CRLF)
EndIf
Attachments (0)
Change History (2)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
| Milestone: | → 3.3.9.5 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [7222] in version: 3.3.9.5

Forgot to mention this was discovered in this thread: http://www.autoitscript.com/forum/topic/139466-solved-open-a-network-location-without-mapping