/    Sign up×
Community /Pin to ProfileBookmark

I am trying to read a registry entry. Our company puts a custom registry entry in HKEY_local_machineSOFTWARE<companyname>. In the entry is the physical location of the machine, Building 32, Room 26. But I cannot get the entry read. Here is my code:

<%@ page contentType=”text/html” %>
<%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core %>

<%@ page import=”com.ice.jni.registry.Registry” %>
<%@ page import=”com.ice.jni.registry.RegistryKey” %>

<%
var WshShell = WScript.CreateObject (“WScript.Shell”);
var loc1 = WshShell.RegRead(“HKEY_LOCAL_MACHINESOFTWAREPOSD”);

This always errs out on the createobject line. I am running this from test.jsp

Richard

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@avitardotnetSep 26.2008 — reading the registry through a webpage is considered a violation of scripting security... the browser security is blocking it.
Copy linkTweet thisAlerts:
@rrm2008authorSep 26.2008 — Can you set the browser security to accept the webpage reading the registry?
Copy linkTweet thisAlerts:
@rrm2008authorSep 26.2008 — oh, also, our desktops do not have internet access, so 'opening' that kind of security breach would not be a problem.
Copy linkTweet thisAlerts:
@avitardotnetSep 27.2008 — you may be able to hack the security settings, but by design even Microsoft realizes this is a security hole. If you need to set the registry settings on your own private network all you have to do is make a login script to do it, or you can use a xnet command if you have a local admin account on all the systems.

I don't reccomend hacking your browsers since any user will be able to default the settings and defeat your settings. Only thing I know of that might be able to violate this sort of security is using an exploit or some sort of applet.

You would be much better off just creating a service or some client app and loading it on all the machines.
Copy linkTweet thisAlerts:
@rrm2008authorSep 27.2008 — Well, if the registry can't be read, why the command regRead?
Copy linkTweet thisAlerts:
@avitardotnetOct 12.2008 — Commands like regRead are only intended for shell scripting through wsh or vbs run locally on the pc. By design they should not run via a web browser except via a security hole.
×

Success!

Help @rrm2008 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...