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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -