windows - Java Runtime exec method throwing error when using with a custom URI -
I am running this command using this command prompt and it is running fine: without any problems:
Start Demo: "-ping -ip 172.18.102.65"
In the above order, demo:
a custom Yury
which I have created and I am crossing the criteria of the Custom Yuri that make it -ping
, -ip
and Lt; An_ip_address & gt;
is Custom Yuri
work.
But when I run the same command using this code, then it does not work:
Runtime.GetReight (). Exec (new string [] {"cmd.exe", "/ c", "start", "demo: \" -ping -ip 172.18.102.65 \ ""}}});
I'm receiving an error message: Windows '-ping' can not be found
How to do this work.
After my explanation of the question, I am writing again for my answer (thanks!).
This syntax works for me:
Runtime .getRuntime (). Exec (new string [] {"cmd.exe", "/ c", "start demo: \" -en -ip-172.18.102.65 \ ""});
It seems that the cloud defines the code in java.lang.ProcessImpl as code \ "
in that way the resulting window command line is incorrect. It is resolved by using "Startup ..." as an argument.
Edit: This URI is used to work in Internet Explorer , You will need to avoid duplicate quotes according to URL encoding rules, thus you The following will be typed in the address bar:
Demo:% 22 -ping -ip 172.18.102.65% 22
Where % 22 < / Code> (hex value)
"
Comments
Post a Comment