[SOLVED] Admin rights lazarus / 34-Windows ---------------------------------------------------------------------- pcurtis · 2022-04-28 05:16 How do I get admin rights so that i can execute an app that require them, in TProcess? The user must, of course, accept the request. The apps I want to execute are third party. ---------------------------------------------------------------------- Zvoni · 2022-04-28 06:42 On Windows? Shell with "runas"? ---------------------------------------------------------------------- pcurtis · 2022-04-28 07:35 My tagline says W10. I found this Delphi code but I can't get it to work Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function RunAsAdmin(hWnd: HWND; filename: string; Parameters: string): Boolean;{    See Step 3: Redesign for UAC Compatibility (UAC)    http://msdn.microsoft.com/en-us/library/bb756922.aspx     This code is released into the public domain. No attribution required.}var    sei: TShellExecuteInfo;begin    ZeroMemory(@sei, SizeOf(sei));    sei.cbSize := SizeOf(TShellExecuteInfo);    sei.Wnd := hwnd;    sei.fMask := SEE_MASK_FLAG_DDEWAIT or SEE_MASK_FLAG_NO_UI;    sei.lpVerb := PChar('runas');    sei.lpFile := PChar(Filename); // PAnsiChar;    if parameters <> '' then        sei.lpParameters := PChar(parameters); // PAnsiChar;    sei.nShow := SW_SHOWNORMAL; //Integer;     Result := ShellExecuteEx(@sei);end; ---------------------------------------------------------------------- Zvoni · 2022-04-28 07:42 Maybe here: https://forum.lazarus.freepascal.org/index.php/topic,32617 .msg210461.html#msg210461 Look at Line 44 et al Wiki: https://wiki.freepascal.org/Executing_External_Programs#Using_Sh ellExecuteEx_for_elevation.2Fadministrator_permissions ---------------------------------------------------------------------- pcurtis · 2022-04-28 15:01 THANKS