HELP !! The system cannot find the file specified

Last post 08-17-2005 4:08 AM by forlorn. 8 replies.

Sort Posts:

  • HELP !! The system cannot find the file specified

    08-15-2005, 10:28 PM
    • Member
      160 point Member
    • forlorn
    • Member since 08-01-2005, 9:22 PM
    • Posts 32
    I'm using the code shown below to call out an .exe file. But it seems i always get 'The system cannot find the file specified ' error and it highlights the Dim p As Process = Process.Start(file). Can anyone tell me how to go about fixing it?

    ' Get a file name relative to the current Web app.

    Dim file As String = Server.MapPath("wmplayer.exe")

    Dim info As New ProcessStartInfo(file)

    'ProcessStartInfo(file)

    info.FileName = file

    ' Redirect output so we can read it.

    info.RedirectStandardOutput = True

    'To redirect, we must not use shell execute.

    info.UseShellExecute = False

    ' Create and execute the process.

    Dim p As Process = Process.Start(file)

    p.Start()

    ' Send whatever was returned through the output to the client.

    Response.Write(p.StandardOutput.ReadToEnd())


  • Re: HELP !! The system cannot find the file specified

    08-16-2005, 4:26 AM
    • Member
      605 point Member
    • PaaB
    • Member since 06-03-2005, 7:08 AM
    • Posts 121
    Add this line after declaration of the file String to show "mapped" file path:
    response.write(file)
    and check if file really exists on the showed path.
  • Re: HELP !! The system cannot find the file specified

    08-16-2005, 5:40 AM
    • Participant
      1,034 point Participant
    • Amit_Boyzone
    • Member since 01-13-2004, 4:44 AM
    • India
    • Posts 205

    Try

    Dim
    file As String
    = Server.MapPath("./wmplayer.exe")

    It may work.

    Thanks & Regards,
    Amit Batra

  • Re: HELP !! The system cannot find the file specified

    08-16-2005, 9:41 PM
    • Member
      160 point Member
    • forlorn
    • Member since 08-01-2005, 9:22 PM
    • Posts 32

    It still can't work after trying both methods. It still returns 'The system cannot find the file specified'  and highlights
    Dim p As Process = Process.Start(file). Kinda desperate here, Someone pls help!!

    Anyway here is the stack trace.
    [Win32Exception (0x80004005): The system cannot find the file specified]
       System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
       System.Diagnostics.Process.Start()
       System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
       System.Diagnostics.Process.Start(String fileName)
       webvault.WebForm1.Button2_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webvault\WebForm1.aspx.vb:69
       System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       System.Web.UI.Page.ProcessRequestMain() +1292


  • Re: HELP !! The system cannot find the file specified

    08-16-2005, 10:39 PM
    • All-Star
      23,604 point All-Star
    • azamsharp
    • Member since 06-11-2003, 9:36 AM
    • Houston,Texas
    • Posts 4,518
    Where is the file stored? Whats the path of the file?
    HighOnCoding
    Get high on ASP.NET articles, videos, podcasts and more!
  • Re: HELP !! The system cannot find the file specified

    08-16-2005, 11:30 PM
    • Member
      125 point Member
    • ShadwSrch
    • Member since 03-16-2005, 11:07 AM
    • Sanford, NC
    • Posts 25
    Does the ASP user on the Machine have correct access permissions set for that folder?
  • Re: HELP !! The system cannot find the file specified

    08-17-2005, 2:07 AM
    • Member
      160 point Member
    • forlorn
    • Member since 08-01-2005, 9:22 PM
    • Posts 32
    The file is stored in C:\Inetpub\wwwroot\webvault. And yes the proper permissions have been given. Kindaa getting desperate here as its my finaly year project and the deadline is closing in. Appreciate any help given.
  • Re: HELP !! The system cannot find the file specified

    08-17-2005, 2:49 AM
    • All-Star
      45,854 point All-Star
    • SomeNewKid
    • Member since 08-10-2003, 12:16 AM
    • Western Australia
    • Posts 8,027
    Try,

       Dim file As String = Server.MapPath("~/wmplayer.exe")
       If Not System.IO.File.Exists(file) Then
          Response.Write("Could not find file: " & file)
          Response.End()
       End If

     
    Alister
  • Re: HELP !! The system cannot find the file specified

    08-17-2005, 4:08 AM
    • Member
      160 point Member
    • forlorn
    • Member since 08-01-2005, 9:22 PM
    • Posts 32
    It seems that i've encountered another problem. A just-in-time debugging prompt appears and states " An exception System.TypeInitializationException has occured". Any solutions?


    ' Get a file name relative to the current Web app.

    Dim file As String = Server.MapPath("~/Monitor.exe")

    If Not System.IO.File.Exists(file) Then

    Response.Write("Could not find file: " & file)

    Response.End()

    End If

    Dim info As New ProcessStartInfo(file)

    'ProcessStartInfo(file)

    info.FileName = file

    ' Redirect output so we can read it.

    info.RedirectStandardOutput = True

    'To redirect, we must not use shell execute.

    info.UseShellExecute = False

    ' Create and execute the process.

    Dim p As Process = Process.Start(file)

    p.Start()

    ' Send whatever was returned through the output to the client.

    'Response.Write(p.StandardOutput.ReadToEnd())

    End Sub

Page 1 of 1 (9 items)