Help Win32Exception, "The System Cannot Find the File Specified"

Joined
Jul 18, 2011
Messages
1
Reaction score
0
This has been bugging me for 6 hours

How on earth is it solved. I want the program to run a batch file (IP) which is both in resources and in the application path (i.e. bin/debug and /release).

The batch file works when double clicked by itself...

What am I doing wrong? Here is my code. I have tried everything on the internet...

Code:
    Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim OK = MessageBox.Show("Are you sure you want to renew the computer's IP?", "IP Renew?", MessageBoxButtons.OKCancel)
        If OK = DialogResult.OK Then
            Dim IP As New System.Diagnostics.Process
            Dim startinfo As New ProcessStartInfo(AppDomain.CurrentDomain.BaseDirectory & "IP.bat")
            startinfo.WindowStyle = ProcessWindowStyle.Hidden
            IP.StartInfo = startinfo
            IP.Start()
        End If
    End Sub

According to the computer, it is opening the right file and it knows its location...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top