cancel
Showing results for 
Search instead for 
Did you mean: 

Java.io.IOException - Cannot run program "C:\Program": CreateProcess error=2

SOLVED
avidCoder
Super Contributor

Java.io.IOException - Cannot run program "C:\Program": CreateProcess error=2

Please look into the below code:-

 

def command = "C:\\Program Files\\PuTTY\\putty.exe -ssh servername -l username -pw password"
def proc = command.execute()
proc.waitFor() 

This code works in soap ui free version and it is able to invoke putty from there. But the same gives error as in Ready API:-

java.io.IOException - Cannot run program "C:\Program": CreateProcess error=2 The System cannot find file.

Could any one please help me to resolve this issue?

@amitkumarlogs - Please follow this questions for more help.

1 ACCEPTED SOLUTION

Accepted Solutions
HimanshuTayal
Community Hero

Re: Java.io.IOException - Cannot run program "C:\Program": CreateProcess error=2

Hi @avidCoder ,

 

Not sure can you try with installing your PUTTY in D drive or to a folder have no spaces in filepath

 

like below one with no space in whole path:

D:\\PuTTY\\putty.exe -ssh servername -l username -pw password"

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

1 REPLY 1
HimanshuTayal
Community Hero

Re: Java.io.IOException - Cannot run program "C:\Program": CreateProcess error=2

Hi @avidCoder ,

 

Not sure can you try with installing your PUTTY in D drive or to a folder have no spaces in filepath

 

like below one with no space in whole path:

D:\\PuTTY\\putty.exe -ssh servername -l username -pw password"

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors