rochinha Posted May 7, 2015 Report Share Posted May 7, 2015 Amiguinhos, Mais uma dica legal para podermos executar ações burlando a segurança do Windows. Testei em um Windows Seven Ultimate 64 com segurança média. RunAsAdmin.prg //////////////////////////////////////////////////////////////////////////// // // Autor: Jose Carlos da Rocha // Data: 07/05/2015 // Email: irochinha@hotmail.com.br // Linguagem: xBase / Fivewin // Plataformas: DOS, Windows // Requerimentos: Harbour/xHarbour // ///////////////////////////////////////////////////////////////////////////// #include "FiveWin.ch" FUNCTION MAIN() ? ; 'ShellExecute( "CMD.EXE", "RUNAS", "", "C:\WINDOWS\SYSTEM32", 1 )',,; ShellExecute( "CMD.EXE", "RUNAS", "", "C:\WINDOWS\SYSTEM32", 1 ) RETURN .T. #pragma BEGINDUMP #include <windows.h> #include <hbapi.h> // ShellExecute( cFile, cOperation, cParams, cDir, nFlag ) HB_FUNC( SHELLEXECUTE ) { hb_retnl( (LONG) ShellExecute( GetActiveWindow(), ISNIL(2) ? NULL : (LPCSTR) hb_parc(2), (LPCSTR) hb_parc(1), ISNIL(3) ? NULL : (LPCSTR) hb_parc(3), ISNIL(4) ? "C:\\" : (LPCSTR) hb_parc(4), ISNIL(5) ? 1 : hb_parni(5) ) ) ; } #pragma ENDDUMP Testado com Fivewin, mas pode muito bem ser portado para o seu modo de programação ideal. Bons usos. Ronaldbuch 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 7, 2015 Report Share Posted May 7, 2015 Em rWindows 7 de 32 bits, também funcionou legal. Valeu Rochinha. abs. rochinha 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.