Jump to content
Sign in to follow this  
LiquidNitrogen

Administrator System - Block Applications

Recommended Posts

LiquidNitrogen

This is Something i Made to block Applications from Being Used without Using the Windows UAC and Stuff. Its Quicker and it Works. Let me know what You Think.

You Need the config.ini file in the Folder with the Script.

Admin System.rar

Edited by ReaperX

Formerly ReaperX

Share this post


Link to post
Share on other sites
PhoenixXL

i dont find anything related to Windows UAC in your code


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
LiquidNitrogen

i dont find anything related to Windows UAC in your code

Its Not Related to it at All. I Just said that this blocks applications without using the UAC.


Formerly ReaperX

Share this post


Link to post
Share on other sites
PhoenixXL

ReaperX,

Upon using your code i found that because of the for while loop the more number of applications , much more time it takes for the script to block the program
Due to which sometimes i see a white glance of notepad

Solution:

I have already made a script like that, it uses registry
Just have a look
Code :

#OnAutoItStartRegister "Startup"
#RequireAdmin
#include <File.au3>

;Author Phoenix XL
;modified 21/05/2013

;block notepad
BlockApplication('notepad.exe')

;unblock when the user closes the Msgbox
MsgBox(64, 'Phoenix XL', 'Notepad Blocked as a Demo...' & @CRLF & 'Notepad would be unblocked upon exit.')
BlockApplication('notepad.exe', 0)
Exit

Func Startup()

    Global $s_regpath
    If @OSArch = "X86" Then
        $s_regpath = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
    Else
        $s_regpath = 'HKCU64\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
    EndIf

    ;all okay then return
    If RegRead($s_regpath, "DisallowRun") = 1 Then Return

    ;we have to write the registry and restart the explorer.
    RegWrite($s_regpath, 'DisallowRun', 'REG_DWORD', 1)
    If @error Then Exit -1

    ;killing explorer and restarting the same would create a unwanted window. Therefore use a batch file.

    ;make the batch file to run the explorer.
    $s_batch = _TempFile(@TempDir, "~", ".bat")
    FileWrite($s_batch, "taskkill /im explorer.exe /f" & @CRLF & "start explorer" & @CRLF & "exit")
    ProcessClose("explorer.exe")


    ;kill and restart.
    ShellExecuteWait($s_batch, "", "", "open", @SW_HIDE)
    FileDelete($s_batch) ;delete the temp file.

EndFunc   ;==>Startup


Func BlockApplication($sAppname, $fBlock = True)

    ;block or unblock an application.
    Switch $fBlock
        Case True
            Return RegWrite($s_regpath & '\DisallowRun', 'block ' & _GetAppName($sAppname), 'REG_SZ', $sAppname)
        Case Else
            Return RegDelete($s_regpath & '\DisallowRun', 'block ' & _GetAppName($sAppname))
    EndSwitch

    ;set error otherwise.
    Return SetError(1, 1, 0)
EndFunc   ;==>BlockApplication

Func _GetAppName($sAppname)
    ;delete the extension from the name of the application
    Return StringRegExpReplace($sAppname, "(.*)\..*$", "\1")
EndFunc   ;==>_GetAppName

Regards
Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
LiquidNitrogen

I noticed the Appearance of Notepad a Little to. I guess i could have done better.


Formerly ReaperX

Share this post


Link to post
Share on other sites
PhoenixXL

tell me what do u think about my code

Due to which sometimes i see a white glance of notepad

Upon seeing it the user may try to find your process and kill it Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
LiquidNitrogen

tell me what do u think about my code

Upon seeing it the user may try to find your process and kill it

Yeah i Didnt think of that and your code is good

Formerly ReaperX

Share this post


Link to post
Share on other sites
PhoenixXL

Thnx for the feedback ;)


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
Sundance

Hi PhoenixXL,

nice code. I'am using Windows7 Prof. 64Bit and i get a returncode of 0 when the RegWrite within the BlockApplication function is called. Somehow i can't write into the DisallowRun Key. (by the way: i can't see the key. Is it normal?). Some idea?

thanks in advance

Sundance

Share this post


Link to post
Share on other sites
PhoenixXL

the script was for 32bit only, i have updated it for to support 64bit windows even.

Recheck if it works..!

P.S. its almost a year the last post of this topic was made, therefore please don't post new queries(Necroing), rather start a new topic.

Regards :)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
Sundance

Hi PhoenixXL,

thanks for the headsup and the modification of the code. I've tried it today on both 32 and 64bit but both show the same error. Win7 won't let me write to that reg position. Will see if i can identify the problem more closer...

 

PS: So this is now no more an old topic i guess?   :huh2:

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
Sign in to follow this  

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Hello all
      I have a question please
      Is there a way to request the script for administrator privileges if a particular condition is met??
      example
      local $path = RegRead("HKEY_CURRENT_USER\Software\test", "fullpath")
      if $fullPath = @scriptFullPath then
      Request for administrator privileges
      main()
      else
      main()
      endIf
      I hope to find a solution here
      Greetings to all
    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      I have a question
      about the display language of the system
      How can I get the current display language and how can I change it by autoit
      Of course, if this is possible
      Greetings to all and hope you help me
    • luny
      By luny
      Hello all, this is what I got so far .. it opens and It won't put in words, I need to log in,,  oops didnt put in code. LOL
       
      #include <IE.au3>
      Local $oUser, $oPass, $oSubmit
      Local $sUser = "lit"
      Local $sPass = "abc"
      Local $url = "http://woodstock:9090/login.jsp?url=%2Findex.jsp"
       

      Local $oIE = _IECreate($url, 1)

      _IELoadWait($oIE)
      $oInputs = _IETagNameGetCollection($oIE, "input")
      for $oInput in $oInputs
          if $oInput.type = "text" And $oInput.name = "userid" And $oInput.size = "12" Then $oUser = $oInput
          if $oInput.type = "password" And $oInput.name = "password" And $oInput.size = "12" Then $oPass = $oInput
          if $oInput.type = "submit" And $oInput.value = "loginformtable" Then $oSubmit = $oInput
          if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop
      Next
      $oUser.value = $sUser
      $oPass.value = $sPass
      _IEAction($oSubmit, "click")
      _IELoadWait($oIE)
       
       
      1  
       
       
    • nss
      By nss
      Hi all,
       
      I'm making an app that among other things has the system info feature, where it displays stuff like the system version, build, CPU and ram stats, etc.
      So, I haven't been able to find anywhere a way to access the following things (is there even?):
      Windows version (not like WIN_10, but the version like 1607, or 1511 Windows edition like professional, home, education, etc. information whether the Windows is registered or not (optionally the registrant's name) the type of the currently logged-in user (e.g., administrator) computer manufacturer and model (e.g., dell inc. Inspiron n5110 boot mode (e.g., safe, normal) CPU tempreture I'd appreciate a lot if any of you could help me with any of the things from above; it would mean a lot to me.
       
      Have a great day.
    • bstjohn
      By bstjohn
      I'm working on a script to copy a subset of files and folders from a PC to a server.  I'm using the extended info from DirGetSize to show how many files and folders and total size that will be copied (copy being done by RoboCopy).  Then I run DirGetSize against the destination when the copy is done to compare against the DirGetSize from the copy source so I can know if anything got skipped.  I'm finding that a lot of stuff is getting skipped.  This lead me to realize that it's because DirGetSize is including files and folders that are hidden and/or system, and I'm excluding these in RoboCopy.  Is there anyway to excluded these from DirGetSize?   I've been unable to find a UDF as yet, and I'd like to do something a little more elegant than piping the output from DIR into a file and reading that back.
       
       
×