Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.06.09;
Скачать: CL | DM;

Вниз

Как запустить программу от имени другово юзера?   Найти похожие ветки 

 
Donpager   (2003-03-28 20:55) [0]

Пробывал вот этот код, но кроме логона ничего не получается :(

procedure TForm1.Button1Click(Sender: TObject);
var
a :Thandle;
b : TStartupInfo;
c : TProcessInformation;
UserName,
AppName,
Domain,
Passw:PAnsiChar;
begin
Username := PChar(Edit1.Text);
Domain := PChar("Domen");
Passw := PChar(Edit2.Text);
AppName := PChar("cmd");
if LogonUser(Username, Domain, Passw, LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_WINNT50,a)
then
begin
Application.MessageBox("","logon OK",MB_Ok);
if CreateProcessAsUser(a,AppName,"",nil,nil,true,0,nil,"c:\",b,c)
then Application.MessageBox("","Start OK",MB_Ok)
else Application.MessageBox("","ERROR",MB_Ok);
end;
end;


 
ZZ ©   (2003-03-29 00:31) [1]

http://www.yandex.ru/yandsearch?text=CreateProcessAsUser
(там будет интересная ссылка на rsdn.ru )


 
doctoraugust ©   (2003-04-10 22:02) [2]

AppName := PChar("cmd"); ==>>>>
The string can specify the full path and file name of the module to execute or it can specify a partial name
:)



Страницы: 1 вся ветка

Текущий архив: 2003.06.09;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.017 c
1-26544
AlexGof
2003-05-26 16:29
2003.06.09
Как узнать открыт ли в MS Word файл ?


1-26504
TCrash
2003-05-30 00:07
2003.06.09
Access violation


3-26400
GSVSerg
2003-05-21 16:43
2003.06.09
Query1:CommandText does not return a result set


3-26344
HardClubber
2003-05-19 19:55
2003.06.09
Работа delphi и mysql вместе


1-26528
servs
2003-05-26 20:52
2003.06.09
OnDestroy для ActiveXForm