How to prevent certain WinXP User from installing any program

Posted on 2004-11-27
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
    LVL 2

    Expert Comment

    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

    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

    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

    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

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video discusses moving either the default database or any database to a new volume.

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now