VisualBasic 2013 - Need Help

Results 1 to 3 of 3
  1. #1
    Enthusiast yggdrazil is offline
    MemberRank
    Aug 2011 Join Date
    36Posts

    VisualBasic 2013 - Need Help

    I try to Make a Launchpad for the AL Emu, how i can start the Batch Files from a Windows Form. I try it with the Command:
    Code:
     Process.Start("AL_Login\StartLoginServer.bat")
    but does Work.


  2. #2
    Member GiGatR00n is offline
    MemberRank
    Oct 2011 Join Date
    Under@shesLocation
    54Posts

    note Re: VisualBasic 2013 - Need Help

    With this code snippet, you can launch and get the output of any DOS like applications.

    This is C# style coding for launching applications:

    Code:
    System.Diagnostics.Process process = new System.Diagnostics.Process();
    
    process.StartInfo.WorkingDirectory = "c:\\";
    process.StartInfo.UseShellExecute = false;
    process.StartInfo.FileName = "cmd.exe";
    process.StartInfo.Arguments = "/c net users";
    process.StartInfo.CreateNoWindow = true;
    process.StartInfo.RedirectStandardInput = true;
    process.StartInfo.RedirectStandardOutput = true;
    process.StartInfo.RedirectStandardError = true;
    process.Start();
    
     // Preparing to get stdout output.
    string stdout = process.StandardOutput.ReadToEnd();
    process.Close();
    
    // Show the results.
    MessageBox.Show(stdout);

    and here is VB.NET style:
    Code:
    Dim process As New System.Diagnostics.Process()
    
    process.StartInfo.WorkingDirectory = "c:\"
    process.StartInfo.UseShellExecute = False
    process.StartInfo.FileName = "cmd.exe"
    process.StartInfo.Arguments = "/c net users"
    process.StartInfo.CreateNoWindow = True
    process.StartInfo.RedirectStandardInput = True
    process.StartInfo.RedirectStandardOutput = True
    process.StartInfo.RedirectStandardError = True
    process.Start()
    
    ' Preparing to get stdout output.
    Dim stdout As String = process.StandardOutput.ReadToEnd()
    process.Close()
    
    ' Show the results.
    MessageBox.Show(stdout)


    but your problem is that you placed your application in wrong path.
    C# Style Coding with your startup path:
    Code:
    Process.Start(Application.StartupPath + "\\AL_Login\\StartLoginServer.bat");
    VB.NET Style Coding with your startup path:
    Code:
    Process.Start(Application.StartupPath & "\AL_Login\StartLoginServer.bat");
    Last edited by GiGatR00n; 18-06-16 at 06:50 AM.

  3. #3
    Novice RedFox is offline
    MemberRank
    Dec 2015 Join Date
    FoxyRieverLocation
    4Posts

    Re: VisualBasic 2013 - Need Help

    gigatr00n it's so complete. is there a way to transform aion emu from Java to c# or VB.NET?



Advertisement