hi
is there a way to block an exe? that user can not run the exe :(
Printable View
hi
is there a way to block an exe? that user can not run the exe :(
Please provide more info....
suppose i dont want to open c:\program files\progDir\ExeName.exe to block how i can do it :(
Using Visual Basic, I don't think you can.
Check msconfig.exe and see what that holds.
You can set a ShellExecuteHook. See post #10 of THIS thread for details on how to do it.
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. :blush:
Is there a solution besides reinstalling Windows? Perhaps rebooting in save mode?
:eek2: you muppet. :rolleyes:
I think undoing what you have done in safe mode sounds like plan.
I know :blush:
Unfortunately that doesn't work. Even in save mode the dll is in use.
can you use a recovery disk to run a system restore?
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.
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
2) In this way you have add the applications full or a part of its caption here the code for itCode: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
if you want to block folders also with second method than use PostMessage() instead of SendMessage()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
i have created this codes for my college project hope this will help you and othes members too.....