473,756 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running a process from ASP.NET

I am trying to spawn a seperate process from my asp page
so when a user clicks the link or button a desktop program
is launched. This will be on an intranet and the program
will exist on the users desktop. I can use the following
code in webmatrix to run a process on my local machine:

<%@ Page Language="VB" %>
<script runat="server">

' Insert page code here
'

Sub Button1_Click(s ender As Object, e As EventArgs)
Dim startInfo As System.Diagnost ics.ProcessStar tInfo
startInfo = New
System.Diagnost ics.ProcessStar tInfo()
Dim p As System.Diagnost ics.Process = New
System.Diagnost ics.Process()
startInfo.FileN ame = "c:\8133324.txt "
startInfo.Windo wStyle =
System.Diagnost ics.ProcessWind owStyle.Normal
p.Start("c:\win nt\notepad.exe" )
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button 1_Click"
runat="server" Text="Button"></asp:Button>
&nbsp;<!-- Insert content here -->
</form>
</body>
</html>
But in .NET Studio running on IIS the process doesn't
spawn. I have tried the following code:

Dim startInfo As New ProcessStartInf o("IExplore.exe ")
startInfo.Windo wStyle = ProcessWindowSt yle.Normal
Process.Start(s tartInfo)

in a button click event, but nothing happens. Any help
would be greatly appreciated.
(Please send VB code, I know C# but this shop uses VB.NET
only)
John
Jul 19 '05 #1
4 9198

John wrote:
|| I am trying to spawn a seperate process from my asp page
|| so when a user clicks the link or button a desktop program
|| is launched. This will be on an intranet and the program
|| will exist on the users desktop. I can use the following
|| code in webmatrix to run a process on my local machine:
||
|| <%@ Page Language="VB" %>
|| <script runat="server">
||
|| ' Insert page code here
|| '
||
|| Sub Button1_Click(s ender As Object, e As EventArgs)
|| Dim startInfo As System.Diagnost ics.ProcessStar tInfo
|| startInfo = New
|| System.Diagnost ics.ProcessStar tInfo()
|| Dim p As System.Diagnost ics.Process = New
|| System.Diagnost ics.Process()
|| startInfo.FileN ame = "c:\8133324.txt "
|| startInfo.Windo wStyle =
|| System.Diagnost ics.ProcessWind owStyle.Normal
|| p.Start("c:\win nt\notepad.exe" )
|| End Sub
||
|| </script>
|| <html>
|| <head>
|| </head>
|| <body>
|| <form runat="server">
|| <asp:Button id="Button1" onclick="Button 1_Click"
|| runat="server" Text="Button"></asp:Button>
|| &nbsp;<!-- Insert content here -->
|| </form>
|| </body>
|| </html>
||
||
|| But in .NET Studio running on IIS the process doesn't
|| spawn. I have tried the following code:
||
|| Dim startInfo As New ProcessStartInf o("IExplore.exe ")
|| startInfo.Windo wStyle = ProcessWindowSt yle.Normal
|| Process.Start(s tartInfo)
||
|| in a button click event, but nothing happens. Any help
|| would be greatly appreciated.
|| (Please send VB code, I know C# but this shop uses VB.NET
|| only)
|| John

This is not possible, IIS, ASP.NET and processes spawned by one of both run in a secured desktop/winstation not the desktop of the
currently logged-on user. So you wont see the "Notepad" window pop-up, but notepad should show up under taskmanager.

Willy.
Jul 19 '05 #2
Do you understand the ASP.NET code is executed on the SERVER?
Steve
"John" <jo************ ****@l-3com.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
I am trying to spawn a seperate process from my asp page
so when a user clicks the link or button a desktop program
is launched. This will be on an intranet and the program
will exist on the users desktop. I can use the following
code in webmatrix to run a process on my local machine:

<%@ Page Language="VB" %>
<script runat="server">

' Insert page code here
'

Sub Button1_Click(s ender As Object, e As EventArgs)
Dim startInfo As System.Diagnost ics.ProcessStar tInfo
startInfo = New
System.Diagnost ics.ProcessStar tInfo()
Dim p As System.Diagnost ics.Process = New
System.Diagnost ics.Process()
startInfo.FileN ame = "c:\8133324.txt "
startInfo.Windo wStyle =
System.Diagnost ics.ProcessWind owStyle.Normal
p.Start("c:\win nt\notepad.exe" )
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button 1_Click"
runat="server" Text="Button"></asp:Button>
&nbsp;<!-- Insert content here -->
</form>
</body>
</html>
But in .NET Studio running on IIS the process doesn't
spawn. I have tried the following code:

Dim startInfo As New ProcessStartInf o("IExplore.exe ")
startInfo.Windo wStyle = ProcessWindowSt yle.Normal
Process.Start(s tartInfo)

in a button click event, but nothing happens. Any help
would be greatly appreciated.
(Please send VB code, I know C# but this shop uses VB.NET
only)
John

Jul 19 '05 #3
John,

This sounds like a browser security issue. I'm 99.9% sure that spawning
processes on the local machine, via a web page, is turned off as it is a
"BIG" security issue, discussed in many patches that MS has put out over the
last year or so.

Try setting your browser security to low and see if that works.

-Evan

"John" <jo************ ****@l-3com.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
I am trying to spawn a seperate process from my asp page
so when a user clicks the link or button a desktop program
is launched. This will be on an intranet and the program
will exist on the users desktop. I can use the following
code in webmatrix to run a process on my local machine:

<%@ Page Language="VB" %>
<script runat="server">

' Insert page code here
'

Sub Button1_Click(s ender As Object, e As EventArgs)
Dim startInfo As System.Diagnost ics.ProcessStar tInfo
startInfo = New
System.Diagnost ics.ProcessStar tInfo()
Dim p As System.Diagnost ics.Process = New
System.Diagnost ics.Process()
startInfo.FileN ame = "c:\8133324.txt "
startInfo.Windo wStyle =
System.Diagnost ics.ProcessWind owStyle.Normal
p.Start("c:\win nt\notepad.exe" )
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button 1_Click"
runat="server" Text="Button"></asp:Button>
&nbsp;<!-- Insert content here -->
</form>
</body>
</html>
But in .NET Studio running on IIS the process doesn't
spawn. I have tried the following code:

Dim startInfo As New ProcessStartInf o("IExplore.exe ")
startInfo.Windo wStyle = ProcessWindowSt yle.Normal
Process.Start(s tartInfo)

in a button click event, but nothing happens. Any help
would be greatly appreciated.
(Please send VB code, I know C# but this shop uses VB.NET
only)
John

Jul 19 '05 #4
Phil.Johnson
1 New Member
I am having a similar problem with this issue, however my process is starting. The application is not firing though. I am trying to open a pdf file (or even a txt file for that matter) located on the local machine. I have
Process.Start(" notepad.exe", @C:\textfile.tx t).
Like i said the Process fires, but the application does not. I looked into the browser security settings. Any help is much appreciated.

Phil
Jul 12 '06 #5

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

Similar topics

2
3410
by: Michael Schmitt | last post by:
Hello. What is the usual way for running functions in parallel on a multiple-processor machine. Actually I want to run a single computationally expensive function with different parameter sets. Running the functions in different threads doesn't seem to work, because of the global interpreter lock. Would it help to fork processes, which run the single function with a given parameter set? Is there any simple way, how this forked worker...
1
2044
by: Marc | last post by:
I want to write a C#/ASP.NET application where a user can go to a web page, start running a job, close their browser, and then come back later and see the results. The purpose for this application is for a user to be able to use a page on our intranet to start running a time-consuming reporting and analysis job. I'm not sure how to start a process in ASP.NET and then "detach" it, or how to check that it's still running later. I think that maybe...
3
442
by: Billg_sd | last post by:
Is there a programatic way in VB.NET to determine if a specific process is running? During an app update, I need to check if the component I'm about to replace is running. In UNIX I'd use: PS | grep -i MyApp Can this be done in .Net?
6
21677
by: Moses M | last post by:
I posted this a short while ago , but I don't think I explained the problem clearly. Task Manager lists processes running on a local system, including a "user name" associated with each process (e.g. SYSTEM). My application needs to check if a particular process is running, and if so get the associated "owner". I am really trying to determine the security context in which the process was started. Thanks for any input. -- Moses
0
2190
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a command button in the application. So the code goes something like this: psiBat = New ProcessStartInfo(arrRun.Item(0)(1)) psiBat.WindowStyle = ProcessWindowStyle.Hidden
4
821
by: sneffe | last post by:
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a textbox on my form. I cant seem to find an easy way to do this in vb.net. Does anybody have a piece of code that can help me? Thanks
1
6025
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the browser back button, it loads the progress bar again. Any solution to this?
5
6582
by: mabond | last post by:
Hi recently read a posting and reply about Excel processs still running after the Appliction.Quit was called. Thought I might be able to use the same (System.Runtime.InteropServices.Marshal.ReleaseComObject(exApplication)) to solve my problem but could not. Background : My app uses a WebBrowser control to display to the user the contents of an Excel spreadsheet.:
14
23169
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
4
2851
by: commander_coder | last post by:
Hello, I write a lot of CGI scripts, in Python of course. Now I need to convert some to long-running processes. I'm having trouble finding resources about the best practices to do that. I've found a lot of email discussions that say something like, "You need to educate yourself about the differences when you have long- running processes" but I've not had a lot of luck with finding things that explain the differences. I've seen some...
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.