18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Error while start
Hi,
I am getting an error saying "Cannot run program "tasklist": CreateProcess error=2, The system cannot find the file specified "
Sahi properties file = E:\sahi\sahi\config\sahi.properties
Sahi user properties file = E:\sahi\sahi\userdata\config\userdata.properties
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi0
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi1
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi2
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi3
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi4
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi5
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi6
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi7
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi8
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi9
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
Cannot run program "tasklist": CreateProcess error=2, The system cannot find the
file specified
Please let me know the solutions to fix this.
I am using Win XP 2
I am getting an error saying "Cannot run program "tasklist": CreateProcess error=2, The system cannot find the file specified "
Sahi properties file = E:\sahi\sahi\config\sahi.properties
Sahi user properties file = E:\sahi\sahi\userdata\config\userdata.properties
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi0
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi1
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi2
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi3
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi4
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi5
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi6
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi7
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi8
Copying profile to E:\sahi\sahi\userdata\browser\ff\profiles\sahi9
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
Cannot run program "tasklist": CreateProcess error=2, The system cannot find the
file specified
Please let me know the solutions to fix this.
I am using Win XP 2
Comments
Looks like your version of XP does not have tasklist. When tests are run in a suite, Tasklist is required to get the PID of the browser process and kill the browser (using taskkill) after a test is done. If it is not available, browsers may not be killed properly. XP generally comes with tasklist and taskkill, so you may want to check why it is not available.
There is another tool available with MicroSoft called PSTools which can be used instead of tasklist and taskkill.
I would suggest you do the following:
1) Install PSTools which is available on the microsoft site.
2) Open sahi/config/os.properties
and change
xp.processhelper.pid_list_cmd=tasklist /FI "IMAGENAME eq $imageName" /NH /FO TABLE
xp.processhelper.pid_list_pid_column_no=2
xp.processhelper.pid_kill_cmd=taskkill /F /PID $pid
to
xp.processhelper.pid_list_cmd=D:\\PsTools\\pslist.exe /accepteula $imageName
xp.processhelper.pid_list_pid_column_no=2
xp.processhelper.pid_kill_cmd=D:\\PsTools\\pskill.exe /accepteula $pid
Make sure you change the path of PSTools according to your setup.
4) Restart Sahi and your error should go away.
Regards,
Narayan