Вопрос

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

Это было полезно?

Решение 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");

Другие советы

you need to escape the first space with \\

Runtime.getRuntime().exec("C:\\Program\\ Files\\AutoIt3\\autoit3.exe ./WindowsAuthenticationLogin.au3");
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top