Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute EXE from ASPX

Status
Not open for further replies.

tqeonline

MIS
Oct 5, 2009
304
US
I have a web server hosting a website. I want there to be a page that is able to execute a script on that server.

I created a page called "Report.aspx" that has 1 button named Button1 (for now)

here is the code i have

Code:
Imports System.Diagnostics
Partial Class Report
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim p As New Process
        p.StartInfo.FileName = "e:/Dashboard Edit/Bin/wkhtmltopdf/wkhtmltopdf.exe"

        Dim url As String = "[URL unfurl="true"]http://sqadashboard.int.asurion.com/Release_Status/Current_Releases.aspx"[/URL]
        Dim outputFile As String = "E:/Dashboard Edit/Reports/Dashboard.pdf"

        p.StartInfo.Arguments = url & " " & outputFile

        p.StartInfo.UseShellExecute = False
        p.StartInfo.RedirectStandardOutput = True
        p.StartInfo.RedirectStandardError = True
        p.StartInfo.RedirectStandardInput = True
        p.StartInfo.WorkingDirectory = "e:/Dashboard Edit/Bin/wkhtmltopdf/"
        p.Start()

        p.WaitForExit(60000)
        p.Close()

    End Sub
End Class

I click the button and there are no errors but there is also no output in the "Reports" directory.

The webpage is acting as the user for that computer.

Am i missing something?

- Matt

"If I must boast, I will boast of the things that show my weakness"

- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top