473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I start a local application from within a web form?

What I would like to do is to have a console application on my server
started when a user performs a specific action on a web form. Specifically,
MyConsoleApp overwrites an existing file with updated info.
MyConsoleApp.exe works just fine and I believe the codewhich calls the
MyConsoleApp.exe (below) is correct. This process fails, with an error:
Access is denied
User Account MyComputer\ASPNET

This makes sense, my computer shouldn't permit an unknown user to write to
my disk. Do I have to create a user account ASPNET and give write
permission in the appropriate directory to this user?
Is trying to do this such a horrendous idea that I should find a different
approach?
Thanks

Phil

I have the following in an appropriate place in my web form:
System.Diagnostics.ProcessStartInfo ProcInfo = new
ProcessStartInfo("c:\\MyConsoleApp.exe", null );

ProcInfo.UseShellExecute = true;

System.Diagnostics.Process Proc = new Process();

Proc.StartInfo = ProcInfo;

Proc.Start();


Nov 29 '05 #1
3 1787
add the ASPNET user to the permissions of the folder. Give it read and
write and you should be good to go

Nov 29 '05 #2
By the way, the username ASPNET already exists by default, the user
that is used can be set in the machine.config

Nov 29 '05 #3
re:
Do I have to create a user account ASPNET and give write permission in the appropriate directory
to this user?
IIRC, you need to run the process with an account
that has permission to access the directory's or file objects.

Look into running MyConsoleApp as ( using runas ) the ASPNET account
(if you gave the necessary permissions to the ASPNET account)
or as any account you want to, as long as it has R/W/M permissions
to the directories/files you need to access/modify.

See :
http://www.microsoft.com/resources/d...-us/runas.mspx

Probably something like this :
System.Diagnostics.ProcessStartInfo ProcInfo = new ProcessStartInfo("runas /user:MyComputer\account
c:\\MyConsoleApp.exe", null );


Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"Phillip N Rounds" <pr*****@cassandragroup.com> wrote in message
news:eq*************@TK2MSFTNGP12.phx.gbl... What I would like to do is to have a console application on my server started when a user performs
a specific action on a web form. Specifically,
MyConsoleApp overwrites an existing file with updated info. MyConsoleApp.exe works just fine and I
believe the codewhich calls the MyConsoleApp.exe (below) is correct. This process fails, with
an error:
Access is denied
User Account MyComputer\ASPNET

This makes sense, my computer shouldn't permit an unknown user to write to my disk. Do I have to
create a user account ASPNET and give write permission in the appropriate directory to this user?
Is trying to do this such a horrendous idea that I should find a different approach?
Thanks

Phil

I have the following in an appropriate place in my web form:
System.Diagnostics.ProcessStartInfo ProcInfo = new ProcessStartInfo("c:\\MyConsoleApp.exe",
null );

ProcInfo.UseShellExecute = true;

System.Diagnostics.Process Proc = new Process();

Proc.StartInfo = ProcInfo;

Proc.Start();


Nov 30 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
0
by: martin | last post by:
Hi, I have a website on my local development machine that has a page where a small number of services (that I have wrote myself) can be either started or stopped. The website uses forms...
1
by: 1Cajun | last post by:
I have an Administration form that I would like to use to not only set some variables for the service but also install and start and stop the service. I have created an install project and can...
6
by: Michael | last post by:
I am running an application that requires "Full Trust" which is declared in the assembly. How do I trap for the System.Security.Policy.PolicyException that is raised by a local machines CAS if...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
3
by: SugarDaddy | last post by:
Here's my problem. I have an NT service (really a .NET service) running as local system. I have a .NET form running on the user account. The form and the service communicate via an IPC Channel...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.