I'm dabbling with the process class and can do basic actions such as ping, ipconfig, etc but am having issues running fan commands. I'm on a Windows machine and have tried it with and without the bin folder in Path. The snippet below is without.
The error I get is "CreateProcess error=193, %1 is not a valid Win32 application".
SlimerDudeThu 29 Dec 2022
Hi FMahony,
The reason behind the error message is because fan is actually fan.bat which, in the world of Win32, is NOT a valid executable that can be run via a Process.
Your options are to either start a new Windows Command Interpreter that can interpret the .bat file:
FMahony Thu 29 Dec 2022
I'm dabbling with the process class and can do basic actions such as ping, ipconfig, etc but am having issues running fan commands. I'm on a Windows machine and have tried it with and without the bin folder in Path. The snippet below is without.
The error I get is "CreateProcess error=193, %1 is not a valid Win32 application".
SlimerDude Thu 29 Dec 2022
Hi
FMahony
,The reason behind the error message is because
fan
is actuallyfan.bat
which, in the world of Win32, is NOT a valid executable that can be run via a Process.Your options are to either start a new Windows Command Interpreter that can interpret the
.bat
file:Or to start a new Java process directly:
FMahony Thu 29 Dec 2022
Thanks,
SlimerDude
! Both options worked like a charm and the explanation was much appreciated.