vb.net - Batch start with parameters Error -


i'm trying make small program includes 2 steps decompile , start .java file. can't run .bat file correctly because dos doesn't accept spaces want.

here's code:

process.start("cmd.exe", "/c start "" """ & textboxjavacpath.text & _ """" & " " & """" & textboxfile.text & """") 

that's string comes out: (it's right)

/c "c:\program files\java\jdk1.8.0_60\bin\javac.exe" "c:\users\niklas\desktop\java\kap06\src\eingabe\letsreadline.java" 

if enter typing in console works, via vb.net doesn't work.

the program input

the error following: the command "c:/program" written incorrect or couldn't found.

try using code (i don't know if it'll work) :

private sub start(javacpath string, file string)     using p new process {         .startinfo = new processstartinfo {             .workingdirectory = path.getdirectoryname(javacpath),             .arguments = "/c """ & path.getfilename(javacpath) & """ """ & file,             .filename = "cmd",             .createnowindow = true}}         p.start()     end using end sub 

and call method :

start(textboxjavacpath.text, textboxfile.text) 

i can't test code, because don't have .java file...


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -