Hi there and happy new year!
The specific user has execution rights for cmd.exe. In addition I am escaping the backslashes in the path, this does not seem to be the issue.
For example if I place the file in the current directory (to avoid the backslashes):
$abc=system("test.bat 2>&1");
printf ("TEST1:");
printf ($abc);
$abc=system("whoami 2>&1");
printf ("TEST2:");
printf ($abc);
assuming that test.bat is just the following:
echo "Hello WOrld!"
print "Hello WOrld!!!!"
I get the following response
TEST1:servername\iwam_plesk(default) TEST2:servername\iwam_plesk(default)
i.e. the test.bat seems to be ignored and does not return anything
whereas if I change the code to this (testttt.bat is missing from the current folder):
$abc=system("testttt.bat 2>&1");
printf ("TEST1:");
printf ($abc);
$abc=system("whoami 2>&1");
printf ("TEST2:");
printf ($abc);
I get
'testtttt.bat' is not recognized as an internal or external command, operable program or batch file. TEST1:operable program or batch file.servername\iwam_plesk(default) TEST2:servername\iwam_plesk(default)
I think it is a permissions issue, but I cannot locate the root of the problem.
Any advice would be highly appreciated.