Results 1 to 11 of 11

Thread: Block Exe

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Block Exe

    hi
    is there a way to block an exe? that user can not run the exe

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: Block Exe

    suppose i dont want to open c:\program files\progDir\ExeName.exe to block how i can do it

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Block Exe

    Using Visual Basic, I don't think you can.

    Check msconfig.exe and see what that holds.

  5. #5
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: Block Exe

    You can set a ShellExecuteHook. See post #10 of THIS thread for details on how to do it.

  6. #6
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    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?

  7. #7
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: Block Exe

    you muppet.

    I think undoing what you have done in safe mode sounds like plan.
    W o t . S i g

  8. #8
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Block Exe

    I know

    Unfortunately that doesn't work. Even in save mode the dll is in use.

  9. #9
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: Block Exe

    can you use a recovery disk to run a system restore?
    W o t . S i g

  10. #10
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    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.

  11. #11
    Lively Member agent_007's Avatar
    Join Date
    Jan 2010
    Posts
    93

    Re: Block Exe

    Quote Originally Posted by chunk View Post
    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
  •  



Click Here to Expand Forum to Full Width