Frage

I am trying to use

Runtime.getRuntime().exec("C:\\Program Files\\AutoIt3\\autoit3.exe ./WindowsAuthenticationLogin.au3");

in java

But failing and displaying fail message as

Cannot run program "C:\Program"

Please tell me how can I give correct path to make it work

War es hilfreich?

Lösung 2

The path needs to have escaped quotes around it if it contains spaces. Alternately, for Program Files directory, you can also use this:

Runtime.getRuntime().exec("C:\\Progra~1\\AutoIt3\\autoit3.exe ./WindowsAuthenticationLogin.au3");

Andere Tipps

you need to escape the first space with \\

Runtime.getRuntime().exec("C:\\Program\\ Files\\AutoIt3\\autoit3.exe ./WindowsAuthenticationLogin.au3");
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top