How to prevent certain WinXP User from installing any program

Posted on 2004-11-27
Medium Priority
Last Modified: 2011-09-20
Hallo Good Experts :)

In my Network, user sometime install the program which not needed or even sometime malicious. I've tried to block Add/Remove program Dialog via Registry, but user can still easily just download a Setup.EXE (for example) from internet and run it - then wholla the computer got TROJAN :(((

How to prevent certain WinXP User from installing any program in Delphi programming ?

Please help me, Thank You
Question by:comicboy
  • 2

Expert Comment

ID: 12686477
mosty trojans don't need to be installed with add/remove, its just a exe opened with a bunch of commands..

1) remove or disable the floppy and cd drives..
2) make a program and name it "SERVICES.EXE" so it can't be deleted from task manager, do commands so it will detect certain windows like the download window in IE or FireFox and have your program CLOSE it, like close the "save as" window..
3) stop them from going into "msconfig" and "registry" and having them removing your program from starting with the system.
4) try the simple code for finding a window and closing it, modify to your needs, if anyone got any beef with this post speak up.

procedure TForm1.Button1Click(Sender: TObject);
  h: HWND;
  while true do begin
    h := FindWindow('IEFrame',nil);
    if not IsWindow(h) then exit;
    PostMessage(h, WM_CLOSE, 0, 0);
function EnumWindowsProc(Wnd: HWND; dummy: integer): BOOL; stdcall;
  ClassName: array [0..7] of Char;
  Result := True;
  GetClassname(wnd, ClassName, SizeOf(ClassName));
  if CompareText('IEFrame', ClassName) = 0 then
  PostMessage(wnd, WM_CLOSE,0,0);

procedure TForm1.Button1Click(Sender: TObject);
i : integer;
EnumWindows(@EnumWindowsProc, i);
procedure TfMain.WMActivate(var Msg: TWMActivate);
  S: String;
  wnd: HWND;
  i: Integer;
  if Msg.Active=0 then
       wnd := Msg.ActiveWindow;
       if wnd = 0 then
          wnd := GetForegroundWindow;
       i := GetWindowTextLength(wnd);
       SetLength(S, i + 1);
       GetWindowText(Wnd, PChar(S), i + 1);

       if Pos('Internet Explorer', S) > 0 then
          PostMessage(wnd, WM_CLOSE, 0, 0);
LVL 17

Accepted Solution

Wim ten Brink earned 1000 total points
ID: 12688068
If you want to prevent users from installing software, restrict their access rights. For example, don't grant them administrative rights but make them normal users.

Then again, to protect those systems against computer virusses and trojans, do whatever everyone else is doing and install an anti-virus product on their systems. For example, Norton Antivirus 2005 is a good one. Kaspersky and MacAfee are good alternatives too. Make sure they cannot disable it, though. And keep them updated all the time.

In Delphi, it means that you have to write your own antivirus software. Not too difficult, if you know what you are doing. Problem is, how to make sure it performs as well as those professional tools. Because your application will be running in the background all the time, monitoring all actions. If it's too intrusive, users will disable it...

Author Comment

ID: 13351706
So sorry, no answer here actually answer my question which to block user install anything via window registry.

So I vote for delete this question.

Thank You

Author Comment

ID: 13351728
For Workshop Alex :

I'm already uses Norton AV even before version 2004, but that doesn't stop user from installing anything, well yes they stop virus, but not all, the problem is not cure the virus or trojan but to prevent them from installing is better.

User access needed to be administrator because they need to operate some software which can save their data. If I restrict the access (which in XP only 2 user Admin or limited) to limited user then the software won't work. Can you point me how to setup an account not only just by admin or limited, such as I can set this account cannot  install software BUT can save data.

For Salz :
Better if I can program to set a certain user privilage such as do not let install program rather than detecting and closing well so many programs...

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question