I need to process a command in cmd and the command looks like this:
"c:\Program Files (x86)\HMA! Pro VPN\bin\HMA! Pro VPN.exe" -changeip
But I can't really add the "
because I will get errors..
Is there a way to do that? What i've tried causes errors:
cmd.exec(""c:/Program Files (x86)/HMA! Pro VPN/bin/HMA! Pro VPN.exe" -reconnect");
How can I escape that character so it works?
Exception in thread "Thread-1" java.lang.IllegalArgumentException: Executable name has embedded quote, split the arguments
at java.lang.ProcessImpl.isQuoted(Unknown Source)
at java.lang.ProcessImpl.getExecutablePath(Unknown Source)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at HMACommand.reconnect(HMACommand.java:15)