Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to disable a particular installed application from the our system using c#
Posted
Comments
Sergey Alexandrovich Kryukov 22-Dec-15 10:33am    
Why?
—SA
BillWoodruff 22-Dec-15 11:36am    
An application you wrote, or ?
Philippe Mori 22-Dec-15 12:09pm    
Uninstall it!

I don't think there is such concept as "disabled application". The application can be installed and uninstalled.

If you really want, you can block the access to the application by setting file permissions, say, for the directory where the application is installed.

The code functionality is explained in this CodeProject article, how to get the list of installed application, with all essential attributes of each such application: Get List of Installed Applications of System in C#[^].

However, I doubt you can solve the problem smoothly. First of all, there is no a reliable method of finding all .lnk files which could be placed on different place of menu, desktop, stack bar (remember, these containers are different for different users) and just in file system, unless you scan all disks on the system. This is because anyone is free to copy any .lnk file or create a new one at any moment. And even if you do it once, any user may add a new .lnk when you re-enable the application, so, if you create and maintain a kind of registry of existing .lnk file, it would be practically useless, because a user can delete or add any of them at any time when the access to the file is available. And, for a final user, the access to the application is mostly done via a .lnk file. If you prohibit access to the application file(s), the .lnk file pointing to the application becomes invalid, which would be confusing to the user.

Besides, there are many applications which don't have installation at all. (To me, they make a lot of sense; and this approach is the best in many cases.)

Anyway, you can implement such application based on permission. To work with file permissions, please see:
https://msdn.microsoft.com/en-us/library/system.security.permissions%28v=vs.110%29.aspx[^],
see also https://msdn.microsoft.com/en-us/library/bb727008.aspx[^].

Now you have everything to develop the application which administer access control to the installed application and supports the set of enabled and disabled applications.

Maybe, I wrong here, because I am not well aware of your goals, but I doubt that such application is really needed. The user knows better what to use and what not. Is it a corporate "culture" (all right, policy) where non-qualified and doing standard routine operations associates needs to be in handcuffs? Just provide standard system setup with fixed set of application and give different categories of workers different permission, by creating specialized user groups.

—SA
 
Share this answer
 
I think the accepted way to do this is to modify the user's group policy (see this[^] article).  To begin to learn how to make changes to a group policy from a C# app, see this[^] post.

/ravi
 
Share this answer
 
how to disable and enable particular installed application of others laptop which is connected both are using wifi , and how to get notification which application currently in run in other laptop which connected though using wifi
can u provide me any solution or code
 
Share this answer
 
Comments
BillW33 22-Dec-15 15:42pm    
You should not add a "Solution" to clarify your question. Instead use the "Improve Question" button to add to or clarify your original question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900