Restricting Certain Processes/Programs from running

  • Thread starter Thread starter Matt Wilson
  • Start date Start date
M

Matt Wilson

Hi,

I'm making a program that basically restricts Microsoft Access from
being opened or ran on all of the company computers (sometimes we need
exclusive access to a database to make changes... that becomes a
problem when we have 50 people who all have Access open and never seem
to hear the announcement to close it).

Here's my problem: How can you keep a process or program from
starting? I realize I could set a very short timer to check
System.Diagnostics.GetProcessesByName("MSACCESS") to see if it's
started... but I'd really like to be able to just restrict it from
running period. Is this possible?
 
This sounds like something that might better be suited to a group policy or
something along those lines. The problem being that you would have to see
the call to msaccess.exe before the OS does and stop it. AFIAK, this is a
lot of work and may be impossible in C#. One possible solution would be to
remap the keys in HKEY_CLASSES_ROOT that deal with all the MSAccess
extensions to your application. Then your application can decide if MSAccess
can run. But, that still leaving the user with the ability to actually drill
down in Program Files and launch the msaccess.exe directly, which I don't
have much faith can be done in managed code.

You might be able to trap the OS messages using P/Invoke and APIs, but you
are looking at A LOT of overhead in this case.

I believe that there are apps out there that can do restrictions of this
sort (some even have scheduling, I believe), like Security Officer for
Windows, that you might want to look at.

Here is a link on WinXP/Win2003 software policies:
http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/rstrplcy.mspx

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

| Hi,
|
| I'm making a program that basically restricts Microsoft Access from
| being opened or ran on all of the company computers (sometimes we need
| exclusive access to a database to make changes... that becomes a
| problem when we have 50 people who all have Access open and never seem
| to hear the announcement to close it).
|
| Here's my problem: How can you keep a process or program from
| starting? I realize I could set a very short timer to check
| System.Diagnostics.GetProcessesByName("MSACCESS") to see if it's
| started... but I'd really like to be able to just restrict it from
| running period. Is this possible?
 
Back
Top