|
-
Jan 22nd, 2010, 11:32 AM
#1
Thread Starter
Fanatic Member
Block Exe
hi
is there a way to block an exe? that user can not run the exe
-
Jan 22nd, 2010, 11:37 AM
#2
Re: Block Exe
Please provide more info....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 22nd, 2010, 11:49 AM
#3
Thread Starter
Fanatic Member
Re: Block Exe
suppose i dont want to open c:\program files\progDir\ExeName.exe to block how i can do it
-
Jan 22nd, 2010, 01:17 PM
#4
Re: Block Exe
Using Visual Basic, I don't think you can.
Check msconfig.exe and see what that holds.
-
Jan 22nd, 2010, 06:58 PM
#5
Addicted Member
Re: Block Exe
You can set a ShellExecuteHook. See post #10 of THIS thread for details on how to do it.
-
Jan 23rd, 2010, 10:33 AM
#6
Re: Block Exe
Now I have a problem. I played around with pcuser's example and wasn't paying attention and I made the huge mistake to set everything to 0, so no executables will run anymore on my computer. This means I can't unregister the dll anymore. 
Is there a solution besides reinstalling Windows? Perhaps rebooting in save mode?
-
Jan 23rd, 2010, 10:56 AM
#7
Re: Block Exe
you muppet. 
I think undoing what you have done in safe mode sounds like plan.
-
Jan 23rd, 2010, 12:14 PM
#8
Re: Block Exe
I know 
Unfortunately that doesn't work. Even in save mode the dll is in use.
-
Jan 23rd, 2010, 12:24 PM
#9
Re: Block Exe
can you use a recovery disk to run a system restore?
-
Jan 23rd, 2010, 12:31 PM
#10
Re: Block Exe
I fixed it. In save mode I managed to get into the system32 folder via 'My Computer' on the desktop and then renamed the dll file. After a reboot everything works fine now.
/me feels really stupid.
-
Jan 23rd, 2010, 11:53 PM
#11
Lively Member
Re: Block Exe
 Originally Posted by chunk
hi
is there a way to block an exe? that user can not run the exe 
chunk you can do this in two ways
1) In this way you have to provide only the actual exe name with its extension and not thr path heres the code
Code:
Private Sub Command1_Click()
If List1.ListCount = 0 Then
MsgBox "Add one item"
Else
Dim i As Integer
For i = 0 To List1.ListCount - 1
Shell ("REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v DisallowRun /t REG_DWORD /d 00000001 /f")
Shell ("REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v " & i & " /d " & List1.List(i) & " /f")
Next i
MsgBox i & " items Blocked Please Logoff to see the effects"
End If
End Sub
Private Sub Form_Load()
List1.AddItem "msconfig.exe"
List1.AddItem "iexplorer.exe"
End Sub
2) In this way you have add the applications full or a part of its caption here the code for it
Code:
Private Declare Function GETWINDOWTEXT Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_CLOSE = &H10
Private Declare Function GetForegroundWindow Lib "user32" () As Long
'Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Sub Form_Load()
List1.AddItem "fire"
List1.AddItem "exp"
List1.AddItem "opera"
End Sub
Private Sub Timer1_Timer()
Dim actH As Long
Dim i As Integer
Dim cap As String * 256
actH = GetForegroundWindow
GETWINDOWTEXT actH, cap, 256
For i = 0 To List1.ListCount - 1
If InStr(1, LCase(cap), LCase(List1.List(i))) <> 0 Then
SendMessage actH, WM_CLOSE, 0, 0
MsgBox "App Blocked By Administrator!!!!", vbOKOnly + vbExclamation, "D&G-RAS-AppBlocker-By Assault"
End If
Next i
End Sub
if you want to block folders also with second method than use PostMessage() instead of SendMessage()
i have created this codes for my college project hope this will help you and othes members too.....
Last edited by agent_007; Jan 24th, 2010 at 12:40 AM.

Im Pro in C#,VB.NET,Batch,Socket Programming, SPY Software Programming, VB6, Win32Api, VBscript, Windows Registry, ASP.NET, PHP, Jquery, AJAX.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|