Vielleicht hilft dir das weiter.
Allerdings:
[WNetRestoreConnectionW is available for use in the Microsoft Windows 2000 and Windows XP operating systems. It may be altered or unavailable in subsequent versions.]
Delphi-Quellcode:
type
TWNetRestoreConnectionW = function (hwndParent:HWND; lpDevice:PWideChar):DWORD; stdcall;
function ReconnectDrive(const path:string):DWORD;
var
libhandle : HMODULE;
func : TWNetRestoreConnectionW;
driveW : WideString;
begin
driveW := ExtractFileDrive(path);
if driveW='' then
Exit;
libhandle := LoadLibrary('mpr.dll');
Result := 0;
if libhandle=0 then
Exit;
try
func := TWNetRestoreConnectionW(GetProcAddress(libhandle, 'WNetRestoreConnectionW'));
if Assigned(func) then
Result := func(0, @driveW[1]);
finally
FreeLibrary(libhandle);
end;
end;