|
-
September 18th, 2008, 09:33 AM
#1
[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
-
September 18th, 2008, 09:51 AM
#2
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.
-
September 18th, 2008, 10:11 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|