Its not Xojo that doesn’t like the path - it doesn’t care as it just hands this off to the OS shell to execute
The SHELL hates the paths as its not quoted properly
It would be a lot easier if you stuck this in a string like
dim cmd as string = """C:\\Users\\Sascha\\AppData\\Local\\JDownloader 2.0\\jre\\bin\\javaw.exe"""
break
sh.Execute(cmd, path)
then see if the cmd is properly quoted when you got to the break point
Xojo has no issue with the path
Its the SHELL trying to execute the invalid path you’ve given it thats the issue
You really should use variables & the debugger to help yourself out
Dim sh As New Shell
Dim path as string = """C:\\Users\\Sascha\\AppData\\Local\\JDownloader 2.0\\JDownloader.jar"""
Dim arg as string = "-Djava.awt.headless=true -jar " + path
dim cmd as string = "C:\\Users\\Sascha\\AppData\\Local\\JDownloader 2.0\\jre\\bin\\javaw.exe"
break
sh.Execute(cmd, path)
And if you look the CMD should be quoted (as it contains spaces) but isn’t and requires the same quoting as the arguments
And thats the command shell complaining about it not being quoted
try
Dim sh As New Shell
Dim path as string = """C:\\Users\\Sascha\\AppData\\Local\\JDownloader 2.0\\JDownloader.jar"""
Dim arg as string = "-Djava.awt.headless=true -jar " + path
dim cmd as string = """C:\\Users\\Sascha\\AppData\\Local\\JDownloader 2.0\\jre\\bin\\javaw.exe"""
break
sh.Execute(cmd, path)
so it still dont work … the messagebox is complaining about the path
so i checked my working Visual Studio project and run it…as you see here is the shell working correctly with the same command. So i dont understand xojo here…
never used jdownloader but it strikes me the right code is
Dim sh As New Shell
Dim arg as string = “-Djava.awt.headless=true -jar ““C:\Users\Sascha\AppData\Local\JDownloader 2.0\JDownloader.jar”””
dim cmd as string = “”“C:\Users\Sascha\AppData\Local\JDownloader 2.0\jre\bin\javaw.exe”""
break
sh.Execute(cmd, arg)
which looks like it should run this headless which the shell would like a lot better
[quote=283332:@Norman Palardy]never used jdownloader but it strikes me the right code is
Dim sh As New Shell
Dim arg as string = “-Djava.awt.headless=true -jar ““C:\Users\Sascha\AppData\Local\JDownloader 2.0\JDownloader.jar”””
dim cmd as string = “”“C:\Users\Sascha\AppData\Local\JDownloader 2.0\jre\bin\javaw.exe”“”
break
sh.Execute(cmd, arg)
which looks like it should run this headless which the shell would like a lot better[/quote]
Doesnt work, the result says something like the messagebox pic above. For me that seems to be a Xojo bug… the shell works normally with batch and VisualStudio works normally too
Doesnt work, the result says something like the messagebox pic above. For me that seems to be a Xojo bug… the shell works normally with batch and VisualStudio works normally too :([/quote]
If it is always the same command you run, just place it into a batch and call the batch from Xojo.
Bear in mind that Shell <> Command LIne. The environment in a shell is not the same as a logged in user. You have to be much more explicit about things like the search path and environment variables. Basically, the mantra for shell programming is: define everything.