Advertisement

10.07.2008 at 08:32AM PDT, ID: 23794129 | Points: 500
[x]
Attachment Details

running BAT file from php page (over ssl, authenticated)

Asked by tg_wilk in PHP for Windows, Microsoft IIS Web Server, Windows Batch Scripting

Tags: ,

Hi

I'm trying to run BAT file from a web page. Php is on IIS (php5isapi win 2003 serv), the page is accessed via ssl (https://) and has anonymous access disabled. So I login on a page as my_user to access the page. Below is the php code that doesn't want to run as expected. When I login directly to the server as my_user I can run this bat file without any problem, so it's not a permissions problem (for this user).
The output looks like this:

kod: 1
ostatnia linijka:
string(0) ""

So as you see it returns an empty string with the return code 1.

This is the bat file:

echo off
echo "Usuwanie katalogu ze stara wersja"
rmdir /S /Q c:\archiwum\trunk
echo "Eksport z repozytorium (trunk)"
cd c:\archiwum
svn export svn://adso.nawigus.pl/test/nawigus/trunk
echo "Kopiowanie do test.nawigus.pl"
xcopy c:\archiwum\trunk C:\Inetpub\nawigus\test /f /s /e /y
echo "Kasowanie plikw base.dist.php, path.dist.php i skompilowanych szablonw"
del /Q C:\Inetpub\nawigus\test\inc\base.dist.php
del /Q C:\Inetpub\nawigus\test\www\path.dist.php
del /Q C:\Inetpub\nawigus\test\inc\tpl\templates_c\*.*
echo "Gotowe"


Any ideas?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
header('Content-Type: text/plain; charset=win-1250');
$last = system('C:\\Documents and Settings\\Administrator\\Pulpit\\svn_trunk.bat',$ret);
echo "kod: $ret\nostatnia linijka:\n";
var_dump($last);
?>
[+][-]10.08.2008 at 03:16AM PDT, ID: 22667476

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 04:51AM PDT, ID: 22667992

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 07:58AM PDT, ID: 22669698

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 08:00AM PDT, ID: 22669719

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.21.2008 at 02:31PM PDT, ID: 22771721

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.23.2008 at 06:20AM PDT, ID: 22785713

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628