MSK wrote:
I am a newbie to ASP.NET and VBScript, currently I am designing a page
to show all the mapped drives using client-side scripts..
I want to read all the mapped drive details (name and Remote Path)
from the registry ("JKEY_CURRENT_USER\Network\") then I want to show
this in list box like
P: \\machine1\folder1
Z: \\mahcine2\folder2
How to read all the keys (i.e.: drive names D,E,F...Z) under "HKCU
\Network" and "RemotePath" key under each drive names using script
(VB or JAVA) ?
Web pages don't normally have access to the registry (or specifically just
to the list of mapped drives), for obvious security reasons. There are
multiple approaches you can look into:
- You can use server-side WMI (see, for example,
http://www.microsoft.com/technet/scr.../hey1027.mspx).
This requires that the web server (and the account the page is running
under) have remote access to the client computer's WMI interfaces.
- You can write an ActiveX component in .NET for accessing the list of
network drives (using WMI, for example) and deploy it in your website. This
requires the use of IE and may need lowered security.
- You can deploy client-side scripts for WMI, which can post the information
to a website (or do anything else with it). These have to be run outside the
web browser, but they can be downloaded from the web browser. Again, this
may need security adjustments.
- You can deploy the application as fully client-side, for example through
ClickOnce.
Note that in most cases, you should prefer WMI to direct registry access, as
it saves you the trouble of interpreting information in the registry
yourself (which is error-prone and subject to breaking on changes). WMI has
a rich object model that exposes just about anything you could be interested in.
--
J.