Sorry, my bad; it was the problem with the COMSPEC path, and it worked after I changed it from c:\windows\system32 to c:\windows\system32\cmd.exe.
Now it was working fine