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

I want to change client's registration key. It works fine when I debug in my pc, but when I deploy to the server it does not work.
Any help would be appreciated.

Thanks a lot

Lilly

==========================
HTML
<script language="javascript" type="text/javascript">
function ReadRegistry() {
var WshShell;
var Key;
try {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Clients\\id", 12345);
Key = WshShell.RegRead("HKEY_CURRENT_USER\\Software\\Clients\\id");
alert(Key);
} catch (e) {
Key = '';
}
}
ReadRegistry();
</script>

==========================
Posted
Updated 24-Nov-11 3:28am
v2
Comments
Yuri Vital 24-Nov-11 9:26am    
In my mind, it's impossible, for security reaseon, to change registry value when the code is located in internet area.

It is working on your machine because you undoubtedly are an admin on the machine and have the permissions. Javascript will run within the browser on the client machine and browsers there will run within a security sandbox that will not allow certain functions, like accessing the registry. Think about, would you want any website you visit to be able to search and modify any values in your Windows registry?
 
Share this answer
 
The javascript that I sent yesterday has been working, the only problem string and int values.

Thanks to everyone
 
Share this answer
 

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