Calling an exe from a network machine

HELJ

Newcomer
Joined
May 29, 2003
Messages
8
I wrote an .exe that works fine but only if you use a local path (like C:\...) to call it. If you try to use a network path to call it (such as \\server\...) it throws a security exception.

Does anyone know how to rectify this? Do I need to add a setting to the assembly itself, or change a permission on the folder it resides in? Other?

Thanks!

Helj
 
Maybe the firewall is blocking the program from having access. I know at home here I have ZoneAlarm and I need to give programs permission to access the computer.
 
I dont think its blocked

I dont think it is blocked because the EXE actually runs, and throws an exception once it starts to run.
 
Error Message

Here is the specific error message:

-----------------------------
An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

Additional information: Request for the permission of type System.Security.Permissions.EnvironmentPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
-----------------------------

I even get this if I try to run it from my own machine, using my own machine's network path (\\mymachine\share\my.exe)

Thanks,

HELJ
 
One last thing. This is a Console Application. I dont think that is a problem but perhaps it is in .NET or something.

Its really just a tool that looks for a file, parses it, and writes to a logfile. I thought a console app that accepted command line arguments was the best way to accomplish this with a small footprint.
 
I don't think what you are trying to do is possible directly. If I try to run a program by double clicking on it from another computer I get an error as well.

You will probably have to run the program through a shortcut and not directly. A batch file would probably be the best thing. You can try this and see if it works. I have not tested it.
 
I once had this problem myself. I could not find a single source of information on it.

What your problem is that .NET has built in security features that will not allow you to access code that the machine does not trust. Thats the security exceptions you are getting.

Now to show you what I mean go to start > Programs > Administrative Tools and the .NET framework 1.X Wizards.

Once you see the window double click on adjust the .NET Security, click on this computer only......and you are trying to an intranet application so click on Local intranet and make the slider show to full trust. Click on and all that and test your app again.

Now i bet your asking how do I make all my clients machines do this without manually going to every machine. Well the only solution to date is what I have implented myself is a seperate .MSI windows intaller file that makes a group policy.

If you interested leave a reply here and i will post instructions as i am not on my development machine here.
 
Back
Top