473,387 Members | 3,684 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,387 software developers and data experts.

How do I call a hidden process from a web app ?

4
Hello all,

I have a web application which needs to call a console application and capture the output of that execution process.

What I have is the following:
Expand|Select|Wrap|Line Numbers
  1. ProcessStartInfo psi = new ProcessStartInfo();
  2. psi.WindowStyle = ProcessWindowStyle.Hidden;
  3. psi.FileName = "doTask.exe";
  4. psi.Arguments = "abc";
  5. psi.UseShellExecute = false;
  6. psi.CreateNoWindow = true;
  7. psi.RedirectStandardOutput = true;
  8.  
  9. Process proc = new Process()
  10. proc.StartInfo = psi;
  11. proc.Start();
  12. string output = proc.StandardOutput.ReadToEnd();
  13. proc.WaitForExit();
  14.  
  15. // print the output from this execution process on a web page.. etc
The problem I have is that no matter which option I set (CreateNoWindow, UseShellExecute..etc), the console application will always pop up when this web page executes. What have I missed ?

However, I have tried to use the same code on a standalone windows app and it's working as expected. Just that when I run this code on a webpage, it just doesn't do what I expected.

Thanks !!
Jun 1 '09 #1
3 2268
Frinavale
9,735 Expert Mod 8TB
A console application has to run in a console.
That's why the console is opened when you execute the console app.

Why is this a problem?
No web user is going to see a console application open and close on the server.
Jun 1 '09 #2
malkin
4
In fact, the console application process is triggered in an ActiveX control which means the console application is already pre-installed in client's PC.

It seems that the options (CreateNoWindow or WindowStyle) doesn't affect the ActiveX control when triggering a process.
Jun 2 '09 #3
Frinavale
9,735 Expert Mod 8TB
Hmm you never mentioned that you were using ActiveX in your original post.

I'm not sure how to prevent this, sorry.
Jun 2 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
0
by: cemal eroglu | last post by:
Hi, I don't use CreateNoWindow=True since I would like to see this application on the task manager (as an application) and I should be able to end the task (and its child processes etc). So I used...
5
by: Susan | last post by:
I have an application. When a user minimizes it it hides itselfs but stays activate in the system tray. Since it is hidden the user may think that they have exited the application and now may...
0
by: Joe Harrison | last post by:
Hello. I have an application which I check to see if there is another running instance at startup. If there is another running instance, I set focus to the existing instance. I am using code...
13
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
6
by: Gerald | last post by:
Hi Group, I want to execute a vbs file from an aspx page. With no success. For instance, simple script that create a text file with 1 line in it. Works fine from commandline or dblclicking on...
1
by: AS | last post by:
Hi, I am opening an exe from my C# windows application, through system.diagnostics.process.start() - process.StartInfo.FileName = "c:\\windows\\system32\\vkey.exe"; ]...
2
by: =?Utf-8?B?UG9ueSBUc3Vp?= | last post by:
Hi, Can i write a vb program to list the hidden process and kill it ? Thanks -- Pony Tsui
6
by: Graham | last post by:
I have long thought there is something missing with HTML forms, in that there should be a provision for a form with hidden input fields, with the whole form being hidden, in particular with no...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.