How to write to DisableTaskMgr registry using JNI?
843829Jan 25 2010 — edited Feb 1 2010Hi, im currently doing my school project, and my project requires to disable the use of Windows Task Manager for security purpose, thus, I need to write a java code to the registry to disable Task Manager.
Currently im using ICE JNIRegistry to write to the registry. Im totally new to JNI, and i need help from you guys. Im using Java Eclipse, and the below is the sample code that i wrote, and im not sure whether is it correct or not :
public void windowOpened(java.awt.event.WindowEvent e) {
try {
Registry registry = new Registry();
registry.debugLevel=true;
RegistryKey regkey = Registry.HKEY_CURRENT_USER;
RegistryKey key =registry.openSubkey(regkey,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",RegistryKey.ACCESS_ALL);
RegDWordValue dWordValue = new RegDWordValue(key,"DisableTaskMgr",RegistryValue.REG_DWORD);
dWordValue.setData(1);
key.setValue(dWordValue);
}
catch(RegistryException ex) {
ex.printStackTrace();
}
Basically when my program is executed, it will trigger the code to set the DWORD value of the DisableTaskMgr to 1. Is there something wrong with my code? I can't test it because currently im hitting an error saying "ERROR You have not installed the DLL named 'ICE_JNIRegistry.DLL'. "no ICE_JNIRegistry in java.library.path". How can i include this ICE_JNIRegistry.DLL into java.library.path?