Can I access the registry from the intranet?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Can I access the registry from the intranet?

  1. #1
    Join Date
    Jul 2007
    Posts
    3

    Can I access the registry from the intranet?

    Hi

    I have a problem. I've written a small VB.net application that should be used by others on our company. So the application will be put on our local network.

    One part of the application analyses parts of the registry to determine which MS Office version the current user has (the reason is that I want to do some standard modifications to each MS Office registry settings).

    Now.. the problem is that this works fine as long as the application is stored on my hard drive. But when I put the application (the exe-file) on the local intranet I get security policy exceptions. I guess that my computer doesn't allow that external applications tries to read my registry(?).

    So my question is if there's a way to write a registry reading program that works from the intranet?

    Please let me know! Just give me a small source code example that should work...

  2. #2
    Join Date
    Jun 2004
    Posts
    93
    The problem you are having is that .Net security on the local computer (the computer running the app) defaults different permissions to a .Net assembly located locally vs. one located on a network drive.

    You can change this security

    Follow these steps:
     Control Panel>Admin tools>Microsoft .NET Framework 2.0 Configuration
     From left tree, select Runtime Security Policy
     From the right, click Increase Assembly Trust
     Select "To this computer" or "This user" to allow this application for the
    computer or user
     Browse to the assembly
     Set security to "Full trust"
     Click "Finish"

    You can also choose Adjust Zone Security to change security for a zone

  3. #3
    Join Date
    Jul 2007
    Posts
    3
    Thanks for your reply, Darren

    But are there other ways to get around this? I have no trouble to let a Windows Shell Script to modify the registry if it is executed from the intranet. Furthermore, an installation program that is executed from the intranet also (often) modifies the registry on my computer when it is installed. Doesn't it? Perhaps I should not use VB.NET??

    I can't go around the entire company and modify the security settings manually on each computer *phew*!

  4. #4
    Join Date
    Jun 2004
    Posts
    93
    Can you state what the error message is you are receiving when you run the VB.Net app from the intranet?

  5. #5
    Join Date
    Jul 2007
    Posts
    3
    Of course:

    "An exception "System.Security.Policy.PolicyException" has occurred in [TheAppName.exe]
    Additional Information: Required permissions cannot be acquired"

    But I wonder if this can be solved without changing the permissions on every computer that should run this program? Does it help to use another compiler (and probably rewrite the code slightly)?

  6. #6
    Join Date
    Jun 2004
    Posts
    93
    On one machine, try to elevate the Intranet Zone security to full trust using the .Net Config tool. Run your app from the Intranet location.
    If it works, you know that this is the problem.

    I know that you can set the .Net Security parameters globally on your network/domain instead of using the tool on each machine. That is a question for a system admin.

Similar Threads

  1. Replies: 4
    Last Post: 03-16-2006, 05:23 PM
  2. ACCESS THE REGISTRY & FIND THE PATH
    By SINNI in forum VB Classic
    Replies: 0
    Last Post: 03-21-2001, 08:00 AM
  3. Replies: 0
    Last Post: 11-24-2000, 07:17 AM
  4. Replies: 0
    Last Post: 11-20-2000, 05:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center