starting a process from an asp page

V

vtxr1300

I'm getting an error The system cannot find the file specified at
System.Diagnostics.Process.StartWithShellExecuteEx when I try to do
Process.Start in my asp.net page. It's version 2 and the path to the
exe is correct. When I open a command prompt and type in everything
that is in the Start method, it works fine. The exe is located in the
root directory of my site (on my local machine) so I'm not sure why it
can't find it. Is this a permissions problem with aspnet trying to
start a process or something else? Either way, how can I fix it?
Thanks.
 
B

Brendan Green

Might be because the ASPNET user doesn't have Log on Locally user rights.

You might be able to get around it by using impersonation, but I'm not sure.

In any case, I think that this is a bad idea. What are you trying to do?
There might be a better way to solve the problem.
 
V

vtxr1300

Brendan said:
Might be because the ASPNET user doesn't have Log on Locally user rights.

You might be able to get around it by using impersonation, but I'm not sure.

In any case, I think that this is a bad idea. What are you trying to do?
There might be a better way to solve the problem.

I have a site where registered users are going to upload mp3s. In
order to save space, I need to convert the bitrate of the mp3, so I've
got the lame.exe and lame_enc.dll in my root folder. I'm trying to
fire that off to resample the mp3 to a lower bit rate. Do you have
another idea of how I could do this? Thanks.
 
B

Brendan Green

How much control do you have over the box that's hosting the site?

What you do is going to depend on what you're able to get away with. For
example, a lot of hosting companies won't let you install additional
software on a server.
 
V

vtxr1300

Brendan said:
How much control do you have over the box that's hosting the site?

What you do is going to depend on what you're able to get away with. For
example, a lot of hosting companies won't let you install additional
software on a server.

They told me that I can have that process run. I've described how it
would reside in my root site directory and they had no problem with it.
Now, I guess it just comes down to permissions. I've used the command
prompt to resample a file and it works fine. However, when I use
Process.Start, it says it couldn't find the file. That doesn't
necessarily sound like a permissions problem, but I'm not sure what
else it would be. I've verified that the path it's using is correct.
 
B

Brendan Green

Hmmm.. What are you passing to Process.Start?

I still think you might not be able to run anything because the ASPNET user
doesn't have "Log on Locally" rights.
 
V

vtxr1300

Brendan said:
Hmmm.. What are you passing to Process.Start?

I still think you might not be able to run anything because the ASPNET user
doesn't have "Log on Locally" rights.

Process.Start(pathToLame + " --abr 64 " + sourceFile + " " + destFile);

This is from memory, so I believe it's correct. There has to be a way
to get this to run with the correct permissions right? I am not too
familiar with impersonation and how it works, but I would think using
that could make it work?
 
B

Brendan Green

And the "pathToLame" contains what?

Are you making an assumption that the hosted website is in the same folder
as your dev machine?
 
V

vtxr1300

Brendan said:
And the "pathToLame" contains what?

Are you making an assumption that the hosted website is in the same folder
as your dev machine?
No, of course not. It's a variable set in my web.config file so I can
easily update it no matter where it's hosted. Anyway, I eventually got
it to work fine, but so far only on my own machine. Now I'm going to
put it on a server at work to see what happens when it's not running on
my own machine. Hopefully if I can get it all working there where we
have some pretty tight security, the web host won't be too difficult to
get up and running. Thanks for your help Brendan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top