Hi there,
why this doesn't work?
Shell("wow.exe")
And... if i do that
Shell("C:\Program Files\World of Warcraft\wow.exe\")
It doesn't work too....
It say File Not Found...
Srry for my english
Printable View
Hi there,
why this doesn't work?
Shell("wow.exe")
And... if i do that
Shell("C:\Program Files\World of Warcraft\wow.exe\")
It doesn't work too....
It say File Not Found...
Srry for my english
You should always check if the file exists before you just shell it off. Also, Process.Start is the preferred way to shell a new process, as it returns you a process object instead of just the PID. Shell is just left in from the VB6 days to make code conversion easier.
Code:If IO.File.Exists("C:\Users\public\games\World of Warcraft\wow.exe") Then
Process.Start("C:\Users\public\games\World of Warcraft\wow.exe")
End If
I think you'll find that the problem is not that the WoW file doesn't exist but rather that WoW itself can't find a file that it's looking for once it's running. A lot of games require that their current directory be the same as their startup directory. If you have a desktop or Start Menu shortcut for WoW then check its properties and you'll probably see that its Working Directory is set. You need to do the equivalent in code, e.g.That said, you should still do as -0 says and test that the file you're executing exists too.vb.net Code:
Dim filePath As String = "C:\Program Files\World of Warcraft\wow.exe" Dim psi As New PrcoessStartInfo(filePath) psi.WorkingDirectory = IO.Path.GetDirectoryName(filePath) Process.Start(psi)