Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have developed an application in MFC,my application is used set the rights or privileges to the user,so as a part of the application,i need to disable few applications from the system using registry.

Example :If i dont want the user use VLC Player or any other applications that are already installed in the machine.So how to disable and enable these application using registry.I will be thank full if some one guide me for this.

Thanks in Advance.
Posted

1 solution

Here[^] is an article from Microsoft. I think Method 2 is very feasible.
 
Share this answer
 
Comments
Rocky_Bas 31-Oct-12 6:16am    
Hi andrew,thanks for the reply ,i have one doubt in this ,in the method 2 it was written that to disable specific application we need DWORD value DisallowRun and set the value to 1 to disable.

So for example if i want to disable VLC player,i need to create a subkey VLC player and then add the DWORD value DisallowRun and set the value to 1 to disable.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion \Policies\VLC media player\DisallowRun

Is the same thing i have to do.
chaau 31-Oct-12 15:13pm    
No, you need to create this key (if it does not exist):

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun

Then, for all programs that you need to disallow create string values, like this:
1=iexplorer.exe
2=notepad.exe
3=calc.exe
4=VlcPlayer.exe

Please note these two things:
* The numbers should be consecutive
* You need to type the exe name.

Try TweakUI program, and see how it does. Then replicate the same in your program
Rocky_Bas 2-Nov-12 22:28pm    
Can this be done using code.
Rocky_Bas 3-Nov-12 3:22am    
Thanks Andrew its working now
Rocky_Bas 3-Nov-12 4:19am    
Hi Andrew there is a small problem iam having in this,its working when i add the key manually through regedit,but when i create the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

its not getting created.


RegCreateKeyEx(HKEY_CURRENT_USER,L"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion \Policies\Explorer\\DisallowRun",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hkey,0);

this is the key i have used to create key but its not working,is there any other way to create the key.

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