CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Location
    Waterloo ON
    Posts
    545

    [RESOLVED] Process.Start

    here is the situation:

    I have one program running on intranet folder which I don't have write permission on. But when the program runs, some temp files need to be saved in current directory. So I got error "Access is denied on ...".

    So I have to create the other program to run the part that produces temp files and then put it on local machine. I use Process.Start to call this program by the program on intranet folder. BUT temp files still go to intranet folder.

    I thought the program on local machine would run individually, actually NO!

    Anybody has idea to solve this problem? Thanks.
    The difficulty is that you have no idea how difficult it is.

    .Net 3.5/VS 2008

  2. #2
    Join Date
    Mar 2008
    Posts
    72

    Re: Process.Start

    That would be a fairly large security hole if you could do that, don't you think?

    What version of .NET are you using, and what do you need to write temp files for? If they're truly temp files for use within your application, you could make a call to GetTempDirectory(), which will give you a directory that you do have permissions to write to.

    Alternatively, you could increase the permissions of your application using caspol, or the .NET framework configuration tool, or by making a custom installer that provides your assembly with the needed permissions.

  3. #3
    Join Date
    Dec 2005
    Location
    Waterloo ON
    Posts
    545

    Re: Process.Start

    Thanks for your reply.

    I added one line to solve the problem.
    Code:
    pro.StartInfo.WorkingDirectory = Path.GetDirectoryName(exefilepath);
    Absolutely no write permission for users on that folder where main application locates. Now it's running very well.
    The difficulty is that you have no idea how difficult it is.

    .Net 3.5/VS 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured