none
System can't find the file specified....

    Question

  • Ok so i had this program working perfectly at home, threw it on a flashdrive and took it to class to add to a program I had to make last week for ethical hacking, now the original program is giving me this error and the code copied over from it to the program from last week is giving me the error... I don't understand why its doing this. here is the code

    Imports System
    Imports System.IO
    
    Public Class Form1
    
        Dim P As New Process
        Dim SW As System.IO.StreamWriter
    
    /*unimportant code from program from last week*/
    
    
        Private Sub Button8_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
    
            P = New Process
    
            TextBox2.Text = ""
    
            Dim netscan As String
    
            AddHandler P.OutputDataReceived, AddressOf DisplayOutput
    
            AddHandler P.ErrorDataReceived, AddressOf DisplayOutput
    
            P.StartInfo.CreateNoWindow() = True
    
            P.StartInfo.UseShellExecute = False
    
            P.StartInfo.RedirectStandardInput = True
    
            P.StartInfo.RedirectStandardOutput = True
    
            P.StartInfo.RedirectStandardError = True
    
            P.StartInfo.FileName = "nmap.exe"
    
            P.StartInfo.Arguments = "-sP"
    
            If CheckBox1.Checked Then
                netscan = InputBox("What is the IPv4 you wish to scan?")
    
                P.StartInfo.Arguments = netscan
    
            Else
    
                netscan = InputBox("What is your default gateway?", "Network Scan")
    
                P.StartInfo.Arguments = netscan & "/24"
    
            End If
    
            P.Start()
    
            P.SynchronizingObject = TextBox2
    
            P.BeginOutputReadLine()
    
            P.BeginErrorReadLine()
    
            SW = P.StandardInput
    
            SW.WriteLine()
    
        End Sub
    
        Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
    
            P = New Process
    
            TextBox2.Text = ""
    
            Dim netscan As String
    
            AddHandler P.OutputDataReceived, AddressOf DisplayOutput
    
            AddHandler P.ErrorDataReceived, AddressOf DisplayOutput
    
            P.StartInfo.CreateNoWindow() = True
    
            P.StartInfo.UseShellExecute = False
    
            P.StartInfo.RedirectStandardInput = True
    
            P.StartInfo.RedirectStandardOutput = True
    
            P.StartInfo.RedirectStandardError = True
    
            P.StartInfo.FileName = "nmap.exe"
    
            P.StartInfo.Arguments = "-sS -p 1-65535 -T4 -A -v"
    
            If CheckBox1.Checked Then
                netscan = InputBox("What is the IPv4 you wish to scan?")
    
                P.StartInfo.Arguments = netscan
    
            Else
    
                netscan = InputBox("What is your default gateway?", "Network Scan")
    
                P.StartInfo.Arguments = netscan & "/24"
    
            End If
    
            P.Start()
    
            P.SynchronizingObject = TextBox2
    
            P.BeginOutputReadLine()
    
            P.BeginErrorReadLine()
    
            SW = P.StandardInput
    
            SW.WriteLine()
    
        End Sub
    
        Private Sub Button10_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
    
            P = New Process
    
            TextBox2.Text = ""
    
            Dim netos As String
    
            AddHandler P.OutputDataReceived, AddressOf DisplayOutput
    
            AddHandler P.ErrorDataReceived, AddressOf DisplayOutput
    
            P.StartInfo.CreateNoWindow() = True
    
            P.StartInfo.UseShellExecute = False
    
            P.StartInfo.RedirectStandardInput = True
    
            P.StartInfo.RedirectStandardOutput = True
    
            P.StartInfo.RedirectStandardError = True
    
            P.StartInfo.FileName = "nmap.exe"
    
            P.StartInfo.Arguments = "-O"
    
            If CheckBox1.Checked Then
                netos = InputBox("What is the IPv4 you wish to scan?")
    
                P.StartInfo.Arguments = netos
    
            Else
    
                netos = InputBox("What is your default gateway?", "Network Scan")
    
                P.StartInfo.Arguments = netos & "/24"
    
            End If
    
            P.Start()
    
            P.SynchronizingObject = TextBox2
    
            P.BeginOutputReadLine()
    
            P.BeginErrorReadLine()
    
            SW = P.StandardInput
    
            SW.WriteLine()
    
        End Sub
    
        Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
    
            P = New Process
    
            TextBox2.Text = ""
    
            Dim netscan As String
    
            AddHandler P.OutputDataReceived, AddressOf DisplayOutput
    
            AddHandler P.ErrorDataReceived, AddressOf DisplayOutput
    
            P.StartInfo.CreateNoWindow() = True
    
            P.StartInfo.UseShellExecute = False
    
            P.StartInfo.RedirectStandardInput = True
    
            P.StartInfo.RedirectStandardOutput = True
    
            P.StartInfo.RedirectStandardError = True
    
            P.StartInfo.FileName = "nmap.exe"
    
            P.StartInfo.Arguments = "-sS -sU -T4 -O -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53"
    
            If CheckBox1.Checked Then
                netscan = InputBox("What is the IPv4 you wish to scan?")
    
                P.StartInfo.Arguments = netscan
    
            Else
    
                netscan = InputBox("What is your default gateway?", "Network Scan")
    
                P.StartInfo.Arguments = netscan & "/24"
    
            End If
    
            P.Start()
    
            P.SynchronizingObject = TextBox2
    
            P.BeginOutputReadLine()
    
            P.BeginErrorReadLine()
    
            SW = P.StandardInput
    
            SW.WriteLine()
    
        End Sub
    
    Private Sub DisplayOutput(ByVal sendingProcess As Object, ByVal output As DataReceivedEventArgs)
    
            TextBox2.AppendText(output.Data() & vbCrLf)
    
        End Sub
    
    End Class
    

    im getting

    A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll

    on "P.Start()"

    last time i had this problem i separated out the commands with the p.start.infoarguments, those are still there so i dont understand why its doing this.  Any ideas?

    Tuesday, April 30, 2013 1:13 PM

Answers

  • -.- i feel so stupid, i forgot we did a wipe and reinstall of the computers here to upgrade to 64bit-os... and i forgot to reinstall nmap.... that would be my problem.....

    correction, thats not the problem... well im sure it was part of it but it wasn't hte overall problem, still getting the error.


    another edit: the code i copied over wont work, for for some reason the original program works so im just porting over the code from the program from last week to the original nmap program i made at home.... so confused but w/e atleast one of them is working.
    Tuesday, April 30, 2013 1:52 PM

All replies

  • Hi,

    I don`t know as though this is the answer to your problem but, i noticed that you are setting the process arguments in all the button click events and then in the If Else statement  rite after it, it is setting it to netscan if the checkbox is checked and if its not checked then it drops down to the Else and sets it to netscan in there. There is not any sense in setting it in the first line shown here if it is only going to be changed in the following If Else statement.  :)

            P.StartInfo.Arguments = "-sS -sU -T4 -O -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53"
    
            If CheckBox1.Checked Then
                netscan = InputBox("What is the IPv4 you wish to scan?")
    
                P.StartInfo.Arguments = netscan
    
            Else
    
                netscan = InputBox("What is your default gateway?", "Network Scan")
    
                P.StartInfo.Arguments = netscan & "/24"
    
            End If


    • Edited by IronRazerz Tuesday, April 30, 2013 1:34 PM
    Tuesday, April 30, 2013 1:32 PM
  • -.- i feel so stupid, i forgot we did a wipe and reinstall of the computers here to upgrade to 64bit-os... and i forgot to reinstall nmap.... that would be my problem.....

    correction, thats not the problem... well im sure it was part of it but it wasn't hte overall problem, still getting the error.


    another edit: the code i copied over wont work, for for some reason the original program works so im just porting over the code from the program from last week to the original nmap program i made at home.... so confused but w/e atleast one of them is working.
    Tuesday, April 30, 2013 1:52 PM