Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Game VB.NET
I seem to have a rather interesting problem with my code. Whenever I launch the code with an extra string in front of it such as Launcherfolder + it gives me some memory access error. However when I remove the string from in front of the "Minecraft.exe" it works fine when launching Minecraft.exe.
 
I need to launch the Minecraft.exe from another folder as you can see, but its not working. So the question is how do I fix this apparently simple problem because the solution escapes me. I think it will launch if minecraft.exe is in the same folder as the Application itself, but as I said I need it to launch from LauncherFolder and not the same directory.
 
Error: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
 
 
Public Class FrmClientScreen
 
    Public Property java As Object
 Dim LauncherFolder As String = Application.StartupPath & "\Killerbees Gaming Client\"
 

    Private Sub btnLogin_Click_1(sender As System.Object, e As System.EventArgs) Handles btnLogin.Click
 
java = CreateObject("WScript.Shell")
 java.Environment("PROCESS")("APPDATA") = LauncherFolder & "packs\" & CboMinecraftVersion.SelectedItem
 java.Run(LauncherFolder + "Minecraft.exe " + txtUsername.Text + " " + txtPassword.Text)
 
End sub
End Class
Posted 18-Dec-12 6:10am
Edited 18-Dec-12 6:12am
v2
Comments
Adam R Harris at 18-Dec-12 12:14pm
   
Maybe you're missing a / or a \ after LaunchFolder and before Minecraft.exe
Richard MacCutchan at 18-Dec-12 13:48pm
   
Where is the Minecraft.exe program actually located? The error message suggests that the path you have created is not the one that leads to this program.
Code Master38 at 18-Dec-12 15:09pm
   
Actually I made sure the file and folder exists. Plus if you actually looked at the code I make adjustments for / in the LauncherFolder string.
ryanb31 at 18-Dec-12 16:41pm
   
Since your paths have spaces you may need "" around the whole thing.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What is the output if you concatenate the filename string into a variable? does it point to the executable?
  Permalink  
Comments
Code Master38 at 19-Dec-12 9:19am
   
Yes it points to the executable, if you had actually read the comments you would know that the code works when I don't add a variable in front of "Minecraft.exe ". And yes the files exist where there should.
tiggerc at 4-Jan-13 5:10am
   
maybe you should use & instead of +

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 271
1 OriginalGriff 253
2 nv3 60
3 Mehdi Gholam 45
4 VJ Reddy 45
0 Sergey Alexandrovich Kryukov 6,696
1 OriginalGriff 6,149
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100