-2

Objective: I need to run this executable program on this path "\172.168.0.46\Inhouse Module\Michael Panaligan\AllUnit\RunCom.exe" It's working on my local computer but not on IIS Server Side. I don't know why it's not working on IIS Server Side when It's completely fine on my local unit. Thank you.

Here's my script.

Imports System.Diagnostics

Public Class CallLegacyApp Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim networkPath As String = "\\172.168.0.46\Inhouse Module\Michael Panaligan\AllUnit" ' Rename folder without spaces
    Dim executablePath As String = "RunCom.exe"

    Try
        ' Map network drive using net use command
        Dim netUseStartInfo As New ProcessStartInfo("net.exe", "use " & networkPath & " /USER:nkti\sdg programmers")
        Process.Start(netUseStartInfo).WaitForExit()

        ' Start the program
        Dim startInfo As New ProcessStartInfo()
        startInfo.FileName = networkPath & "\" & executablePath
        Process.Start(startInfo)
    Catch ex As Exception
        Response.Write("Error: " & ex.Message & "<br/>" & ex.StackTrace)
    End Try

End Sub

Here's what I did. Tried to understand Shell and Process.Start function, Did some research and ask AI.

What I'm expecting is to run the executable program on client side computers.

  • 2
    You expect a webpage to execute some arbitrary process on the client computer? That would be a huge security hole if it where possible. I would expect trying to execute it on the server to also run into security protections, but there you might have some chance of disabling the security – JonasH Aug 15 '23 at 09:41
  • What kind of error does it return? Note that in IIS the code is executed under the user identity 'IIS APPPOOL\' which belongs to IIS_IUSRS group. It may have limited permissions. – Sergey Aug 15 '23 at 10:18
  • It is difficult to reproduce your problem based on your description, do you get any error messages when running the executable program on iis? – samwu Aug 16 '23 at 03:34

0 Answers0