문제

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