tags:

views:

287

answers:

4

When I am running the application I can access the file.. When I am running the executable that is created, I cannot access the file.. Any suggestions?

The error I am getting is : access to the path 'E:\Javascript.js' is denied.

+1  A: 

I would check:

  1. The permissions the executable is running under.
  2. The path to the file is correct (it's not accidentally using a relative path).
Kevin
I checked the permissions and they seem ok.The path is correct (double checked).
Stavros
A: 

Check the user permissions for the path & exe.

Here's how: Source

gmcalab
A: 

The default permissions for an executable sometimes depend on where the executable is located (e.g., a network share vs. local hard drive) and where it came from (e.g., downloaded from the Internet). Check the properties of the executable file.

You should also check Control Panel->Administrative Tools->.Net Framework 2.0 Configuration->Configure Code Access Security Policy.

Jeffrey L Whitledge
A: 

How are you accessing the file?
Are you executing it or are you reading it?
If you're reading it, what filemode and sharemodes are you using?
Is it possible that some other process has an open handle to the file (a previous instance of your application that's still running perhaps, or the editor used to create the file)?

ho1