begin
dwType := RESOURCETYPE_DISK;
lpLocalName := nil;
- lpRemoteName := PChar(ListBox1.Items[ListBox1.ItemIndex]);
+ lpRemoteName := PChar(ListBox1.Items[ListBox1.ItemIndex]+'\IPC$');
lpProvider := nil;
end;
password := PChar('');
user := PChar('');
- lResult := WNetAddConnection2(NR, password, user, 0);
+ lResult := WNetAddConnection2(NR, password, user, CONNECT_UPDATE_PROFILE);
if lResult in [NO_ERROR, ERROR_ALREADY_ASSIGNED] then
begin
path := ExcludeTrailingPathDelimiter(NR.lpRemoteName);