farhadrahman2

Giving Administrative Rights

7 posts in this topic

Hey guys I want to have two buttons in a GUI both to open cmd .I want one button to start cmd normally and another to start it with administrative privileges . and I also want to show the name of the application in the user account control  dialog box my program is executing and not the name of the  program I created.

I hope you understand my problem.

Thanks In Advance.

 

 

Share this post


Link to post
Share on other sites



Whoa !!! Problem solved thank you very much .

Much happy now

 

Share this post


Link to post
Share on other sites

Okay so there's one more problem.

I created a check box when checked opens cmd as admin.

But I am not able to make it transparent when using

GUICtrlSetBkColor($check,$GUI_BKCOLOR_TRANSPARENT)

Please help.

Share this post


Link to post
Share on other sites

see Reamarks to GuiCtrlSetBkColor:

Quote

Checkbox, Radio, Group Progress, Combo controls cannot be painted if the "Windows XP/Vista style" is used.

This helps:

DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($idCtrl), "wstr", 0, "wstr", 0)

you must replace $idCtrl with the CntrolId of your checkbox.

Share this post


Link to post
Share on other sites

When I check the check box the cmd opens as admin but the check box remains checked.

How do I make it uncheck automatically as soon as it opens cmd.

Share this post


Link to post
Share on other sites
10 hours ago, AutoBert said:

see Reamarks to GuiCtrlSetBkColor:

This helps:

DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($idCtrl), "wstr", 0, "wstr", 0)

you must replace $idCtrl with the CntrolId of your checkbox.

Still not working.

My script

#include <ColorConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <MsgBoxConstants.au3>
#NoTrayIcon
#region
#AutoIt3Wrapper_Res_Comment=Launcher - PC Hackz™
#AutoIt3Wrapper_Res_Description=PC Hackz™
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Everybody in this world
://////=__=
://////=__=
#endregion

Example()

Func Example()
FileInstall("DEFAULT_GUI_PIC.jpg" , @TempDir & "\FXDZHXE.SYS")
FileInstall("ICon.jpg" , @TempDir & "\FXDZHXN.SYS")

Local $hGUI = GUICreate("Launcher - By PC HACKZ",640,400)



Local $idpic = GUICtrlCreatePic(@TempDir & "\FXDZHXE.SYS",1,1,640,400)
  Local $icon =  GUICtrlCreatePic(@TempDir & "\FXDZHXN.SYS" ,190,330,194,54)
 Local $Check = GUICtrlCreateCheckbox("Admin",110,295,45,20)

DllCall("UxTheme.dll","int","SetWindowTheme","hwnd",GUICtrlGetHandle($Check),"wstr",0,"wstr",0)

GUICtrlSetTip($Check,"Check This To Run CMD As Admin") 
WinSetTrans($hGUI,"",200)
 
      
              GUICtrlSetState($idpic,$GUI_DISABLE)

          
Local $idOK = GUICtrlCreateButton("Launch Notepad ",5,260, 90, 30)

GUICtrlSetTip($idOK,"Click Here To Launch Notepad")

 Local $fucj = GUICtrlCreateButton("Launch  CMD ",5,295,90,30)

GUICtrlSetTip($fucj,"Click Here To Launch Command Prompt") 

Local $fuck = GUICtrlCreateButton("Launch Paint ",5,330,90,30)

GUICtrlSetTip($fuck,"Click Here To Launch Paint")

Local $fucl = GUICtrlCreateButton("Launch Narrator ",5,365,90,30)

GUICtrlSetTip($fucl,"Click Here To Launch Narrator")

Local $fucg = GUICtrlCreateButton("Launch Wordpad ",545,260,90,30)

GUICtrlSetTip($fucg,"Click Here To Launch Wordpad")

 Local $fucs = GUICtrlCreateButton("Launch System Info. ",530,295,105,30)

GUICtrlSetTip($fucs,"Click Here To See Your System's Information")

Local $fuch = GUICtrlCreateButton("Launch Registry Editor ",520,330,115,30)

GUICtrlSetTip($fuch,"Click Here To Make Changes To Your Registry ")

Local $fuci = GUICtrlCreateButton("Launch Resource Monitor ",505,365,130,30)

GUICtrlSetTip($fuci,"Click Here To Monitor Your Resources")

Local $about = GUICtrlCreateButton("About",545,5,90,30)

GUICtrlSetTip($about,"Click Here To Get Some Intel About US")



               

GUISetState(@SW_SHOW,$hGUI)





    While 1

        Switch GUIGetMsg()



Case $idOK

ShellExecute("notepad.exe")

Case $fucj

ShellExecute("cmd.exe" )

Case $fuck

ShellExecute("mspaint.exe")

Case $fucl

ShellExecute("Narrator.exe")

Case $fucg

ShellExecute("C:\Program Files\Windows NT\Accessories\wordpad.exe")

Case $fucs

ShellExecute("msinfo32.exe")

Case $fuch

ShellExecute("regedt32.exe")

Case $fuci

ShellExecute("resmon.exe")

Case $about  

MsgBox(8256,"Launcher - About","Launcher - By PC HACKZ" & @CRLF & "" & @CRLF & "Version - 1.0" & @CRLF & "" & @CRLF & "Made By PC HACKZ" & @CRLF & "" & @CRLF & "Like US & Share our posts." & @CRLF & "" & @CRLF & "Visit www.pchackz.wordpress.com ." & @CRLF & "")

Case $icon

ShellExecute("www.pchackz.wordpress.com")

Case $Check

ShellExecute("cmd.exe","","","runas")

Case -3

FileDelete( @TempDir & "\FXDZHXE.SYS")

FileDelete( @TempDir & "\FXDZHXN.SYS")

Exit







        EndSwitch

    WEnd
 
EndFunc

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now