Call BAT file from PHP on IIS 6.0 server

I am trying to call a bat file from php.  I am testing this so the contents of the bat file is:
Msg * "If this opened, the call worked"

All it is intended to do is open a message box with some text.

This attached code just shows DONE! on the screen when I clock the Do It button.  The message box does not open.

The full path to the bat file is:

The full path to the php file is:

Any ideas?
echo "Done!";
} else {
// display the form
<form action="" method="post">
<input type="submit" name="submit" value="DO IT!">

Open in new window

Who is Participating?
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
You will have to go into IIS Admin, locate that file 'bat' file in the website, right click on it, select properties, and give Execute permissions since 'bat' files are considered 'executable' files.  Default permissions are 'read only' on files in IIS unless you change them.
ScamquistAuthor Commented:
I can't seem to find where to permit the bat file as an executable.
Am I looking in the wrong place?

 IIS Image
Dave BaldwinFixer of ProblemsCommented:
Click on "Script source access" then.  I was expecting something else.  I tried it and I got this:

Warning: exec() [function.exec]: Unable to fork [PHP_Call.bat] in C:\Inetpub\wwwroot\EXECBAT.PHP on line 13
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

ScamquistAuthor Commented:
Checked "Script source access"

Opened the page.  Clicked Do IT!

no error.  Just displayed DONE!
Dave BaldwinFixer of ProblemsCommented:
Then it's probably working.  The message would displayed on the command line since it's a command line batch file.  But you're not on the command line, you're in your browser so you woudln't see it.
ScamquistAuthor Commented:
Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.