I'm working on an Inno Setup installer, which calls net use
to connect to a shared server. The installer can connect to the server, if it's running on Windows XP, but not on Windows 7. I think it's related to UAC as I type the same command, the server is connected on Windows 7, but the setup is running with admin
privileges.
I'm using the following net use
command through Exec
or ShellExec
script functions:
/c net use \\servername password /user:username
Actually, here is a part of the script showing the net use
command call:
[Code]
var
ErrorCode: Integer;
cmdString: String;
intvalue: Integer;
str: String;
function InitializeSetup(): Boolean;
begin
cmdString := '/c net use \\servername password /USER:username';
ShellExec('', ExpandConstant('{cmd}'), cmdString , '', SW_SHOWNORMAL,
ewWaitUntilTerminated, ErrorCode)
if (ErrorCode = 0) then
begin
MsgBox(ExpandConstant('{cmd}'), mbInformation, MB_OK);
end;
end;
Can anybody suggest how to use net use
from Inno Setup on Windows 7? We just want to connect to a server and let user input name and password.
Thank you!