Pentaho Windows Batch file not running when executed on Windows Server 2008

batch-filecommand-line-interfacewindows-server-2008

I'm running a Pentaho Kettle Kitchen batch scripts on Windows Server 2008. When I launch the batch file, the Windows Command prompt pops up and then disappears. I've changed all files in the folders being accessed to non-read only and gave full permissions to Administrator.

What is likely the problem?

How do I troubleshoot this sort of thing on Windows?

Best Answer

Not knowing anything about what the batch file does, and just treating this as a general batch file troubleshooting question, it would be a good first step to run the batch file from a command prompt (as opposed to just clicking on the file in Windows Explorer) so that you can see the output.

Some rudimentary cmd.exe usage knowledge is necessary, but it's something you really should know how to do and worth the time.

  • Start cmd.exe
  • The prompt in the "Command Prompt" window will reflect the current drive-letter and path. If your batch file is on a different drive letter (say, "X:") then start by entering the drive letter, a colon, and pressing <ENTER> to change the current drive.
  • Use the cd command to change directory into the folder with the batch file. (Many batch files are written with the assumption that the current directory will be set to the directory the batch file is located in.) Usually I'm lazy and will copy / paste the path from a Windows Explorer window into the command prompt. The syntax of the command is cd directory-name, but be sure to surround the directory name with double-quotes if it contains spaces.
  • Once the prompt reflects the proper drive letter and directory enter the name of the batch file (the .cmd or .bat isn't strictly necessary) and press <ENTER>. This will execute the batch file and, unless the batch file author was a jerk and included an exit statement in the file, the command prompt window will remain open.

(Somebody might suggest editing the batch file, adding a pause statement at the end, and just double-clicking it in Windows Explorer. That will work in many cases, however I make use of the goto :EOF functionality in a lot of my batch files such that the pause would never happen. On that basis I am not suggestion that strategy to you.)

I don't know anything about "Pentaho Kettle Kitchen", but I suspect you've got a situation where the batch file needs to be "Run As Administrator" in order to give the programs being executed a real Administrator user token.