We have a batch file which is calling php scipts. Php script load some data files to our system.

I cannot understand what is starting that batch file in the middle of the night. I cannot find any task job scheduled to run that batch file. There are other machines that have access to this shared storage location where batch file is located.

Is there any command that I can add to the batch script or PHP script which will print all process details when this batch file is called in the middle of the night? So, I can later read that log and understand how is this script called.


1 Answer 1


You can use Windows Sysinternals "Process Explorer" utility to find out which process started the batch script. Find cmd.exe process that is executing the batch script commands. The process above the cmd.exe process is the process started the batch file. if there are multiple cmd.exe processes you can view the command line for each cmd.exe process by clicking "View --> Select Columns" and from "Process Image" tab place check mark for the "Command Line" check box.

  • Thanks for your comment. I am rather looking for a command to add to the script and output to a log file. I cannot be sure when the script is ran at night to do check it manually.
    – vlr
    Aug 27, 2014 at 17:28
  • I want something like: $parent_process = system.getParentProcess(); echo $parent_process;
    – vlr
    Aug 27, 2014 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .