473,471 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Please help...

I use Web Application, that stored on some server.

I need to run other application with arguments from the code that stored
on same server with the application. Instead of using command line I need
to run this application from the code.

Can you give me code lines how to run applicaion from the code?

I tried to use System.Diagnostics.Process but it didn't work.

Thanks for your answer.

Nov 16 '05 #1
8 2911
adish11 <ad*****@walla.co.il> wrote:
I use Web Application, that stored on some server.

I need to run other application with arguments from the code that stored
on same server with the application. Instead of using command line I need
to run this application from the code.

Can you give me code lines how to run applicaion from the code?

I tried to use System.Diagnostics.Process but it didn't work.


It would help if you'd show how you tried to use
System.Diagnostics.Process and in what way it didn't work.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Let me understand correctly... you want a web application to trigger a
command line application on the same machine. You tried
System.Diagnostics.Process to start the command line application, but it did
not work.

Is this a correct statement of your problem?

You are probably getting a permissions issue. The web application does not
run as a trusted user on your server, and has some fairly limited
capabilities.
We may be better able to help you if you follow Jon's advice, and post the
error message and the code where you attempted to start to other process.

Note: if the application you are trying to start is a windows application, I
would suggest that you need to find another way... the user interface for
the windows application would appear on the console if anyone is logged in
(if you are lucky). Dialog boxes would wait for human input on an
unattended machine, and your web application would freeze up. This is not
reliable.

I hope this helps and I look forward to seeing your follow up post.

--- Nick

"adish11" <ad*****@walla.co.il> wrote in message
news:a3******************************@localhost.ta lkaboutsoftware.com...
I use Web Application, that stored on some server.

I need to run other application with arguments from the code that stored
on same server with the application. Instead of using command line I need
to run this application from the code.

Can you give me code lines how to run applicaion from the code?

I tried to use System.Diagnostics.Process but it didn't work.

Thanks for your answer.

Nov 16 '05 #3
adish11 wrote:
I use Web Application, that stored on some server.

I need to run other application with arguments from the code that stored
on same server with the application. Instead of using command line I need
to run this application from the code.

Can you give me code lines how to run applicaion from the code?

I tried to use System.Diagnostics.Process but it didn't work.

Thanks for your answer.


I do something like that in a web application that required PGP. I decided
to use GnuPG ( www.gnupg.org ) which is a line command exec. I found a
class that someone had written that encapsulated the command with it's
switches and turned them into methods. Here's the article and download.

http://www.codeproject.com/csharp/gnupgdotnet.asp

I found that when I implemented this code I needed to make sure that the
ASPNET account was on the subdirectory that the .exe was installed in.

Also, look at his code for how to trap errors from the line command.
--
incognito @ http://kentpsychedelic.blogspot.com/

Man is the best computer we can put aboard a spacecraft ... and the only one
that can be mass produced with unskilled labor. -- Werner von Braun
Nov 16 '05 #4
Hi,

The code as I tried in different versions:

Ver #1:
System.Diagnostics.ProcessStartInfo startupInfo = new
System.Diagnostics.ProcessStartInfo();

startupInfo.FileName = "C:\\psexec.exe";
startupInfo.Arguments = "\\toc2";

startupInfo.UseShellExecute = false;
System.Diagnostics.Process process =
System.Diagnostics.Process.Start(startupInfo);
Ver #2:
Process p = new Process();
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "C:\\psexec.exe";
p.Start();

Ver #3:
System.Diagnostics.Process.Start("C:\\psexec.exe") ;

Can you see where can be my error?

Thanks for helping me

Nov 16 '05 #5
Hi,

The code as I tried in different versions:

Ver #1:
System.Diagnostics.ProcessStartInfo startupInfo = new
System.Diagnostics.ProcessStartInfo();

startupInfo.FileName = "C:\\psexec.exe";
startupInfo.Arguments = "\\toc2";

startupInfo.UseShellExecute = false;
System.Diagnostics.Process process =
System.Diagnostics.Process.Start(startupInfo);
Ver #2:
Process p = new Process();
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "C:\\psexec.exe";
p.Start();

Ver #3:
System.Diagnostics.Process.Start("C:\\psexec.exe") ;

Can you see where can be my error?

Thanks for helping me

Nov 16 '05 #6
Hi Nick,
Yes, you understood my problem correctly.

I'll try to describe you my work environment:

Client works on one machine, web application runs on other(second) machine
and there on more machie(third), where stored batch file that I need to
activate.
All the machines are at the same network.

By running the application I want to run Psexec application that stored on
the same second machine with the application.

PsExec is a light-weight telnet-replacement that lets execute processes
on other systems,I need to run this application with arguments to run
remote file that stored on third machine in the network.
http://www.sysinternals.com/ntw2k/freeware/psexec.shtml

I hope you understood my environment.

While ruuning the code I don't get any exeptions but the file not being
executed.I tried it also with other application like calc.exe or
notepad.exe ,but nothing happends.

The strange thing is that I tried to run same code on Windows Application
and it works fine there.

Do you think it's a permission problem?

Thank you very much for you help
Nov 16 '05 #7
<"" <>> wrote:
The code as I tried in different versions:


And what happened when you tried them?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #8
The responder "Donny Darko" did a good job of pointing you to a sample that
can show you how to fix this problem.

You need to make sure that the ASPNET account that is running the web
application has the ability to execute the PSEXEC application that you refer
to.

If this is not working for you, an alternative is to tell your web
application that it should impersonate a particular web user (which can be
done in the web.config).

As another alternative, you could change the service that IIS is running
under.

And lastly, if you have IIS6 (windows server 2003), then you can create an
application pool with specific identity properties.

I hope this helps,
--- Nick

"adish11" <ad*****@walla.co.il> wrote in message
news:7e******************************@localhost.ta lkaboutsoftware.com...
Hi Nick,
Yes, you understood my problem correctly.

I'll try to describe you my work environment:

Client works on one machine, web application runs on other(second) machine
and there on more machie(third), where stored batch file that I need to
activate.
All the machines are at the same network.

By running the application I want to run Psexec application that stored on
the same second machine with the application.

PsExec is a light-weight telnet-replacement that lets execute processes
on other systems,I need to run this application with arguments to run
remote file that stored on third machine in the network.
http://www.sysinternals.com/ntw2k/freeware/psexec.shtml

I hope you understood my environment.

While ruuning the code I don't get any exeptions but the file not being
executed.I tried it also with other application like calc.exe or
notepad.exe ,but nothing happends.

The strange thing is that I tried to run same code on Windows Application
and it works fine there.

Do you think it's a permission problem?

Thank you very much for you help

Nov 16 '05 #9

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

Similar topics

0
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
7
by: tyler_durden | last post by:
thanks a lot for all your help..I'm really appreciated... with all the help I've been getting in forums I've been able to continue my program and it's almost done, but I'm having a big problem that...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
13
by: Joner | last post by:
Hello, I'm having trouble with a little programme of mine where I connect to an access database. It seems to connect fine, and disconnect fine, but then after it won't reconnect, I get the error...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
0
by: 2Barter.net | last post by:
newsmail@reuters.uk.ed10.net Fwd: Money for New Orleans, AL & GA Inbox Reply Reply to all Forward Print Add 2Barter.net to Contacts list Delete this message Report phishing Show original
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
5
by: tabani | last post by:
I wrote the program and its not giving me correct answer can any one help me with that please and specify my mistake please it will be highly appreciable... The error arrives from option 'a' it asks...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.