LiquidNitrogen Posted June 2, 2012 Posted June 2, 2012 (edited) 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 June 2, 2012 by ReaperX Formerly ReaperX
PhoenixXL Posted June 2, 2012 Posted June 2, 2012 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.
LiquidNitrogen Posted June 2, 2012 Author Posted June 2, 2012 i dont find anything related to Windows UAC in your codeIts Not Related to it at All. I Just said that this blocks applications without using the UAC. Formerly ReaperX
PhoenixXL Posted June 2, 2012 Posted June 2, 2012 (edited) 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 : expandcollapse popup#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 May 22, 2013 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.
LiquidNitrogen Posted June 4, 2012 Author Posted June 4, 2012 I noticed the Appearance of Notepad a Little to. I guess i could have done better. Formerly ReaperX
PhoenixXL Posted June 4, 2012 Posted June 4, 2012 (edited) tell me what do u think about my codeDue to which sometimes i see a white glance of notepadUpon seeing it the user may try to find your process and kill it Edited June 4, 2012 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.
LiquidNitrogen Posted June 8, 2012 Author Posted June 8, 2012 tell me what do u think about my codeUpon seeing it the user may try to find your process and kill itYeah i Didnt think of that and your code is good Formerly ReaperX
PhoenixXL Posted June 8, 2012 Posted June 8, 2012 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.
Sundance Posted May 21, 2013 Posted May 21, 2013 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
PhoenixXL Posted May 22, 2013 Posted May 22, 2013 (edited) 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 May 22, 2013 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.
Sundance Posted May 22, 2013 Posted May 22, 2013 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now