473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

batch file issue...

I am using php 5.2.5 via a wamp server on my machine. I have created a
web interface to a mysql database using php. The web interface has a
link to a php file which calls a dos batch file like this:

$Text = shell_exec("c:\mydatabase\convertdb.bat $Language");

where $Language is set to "English" or "Chinese" etc etc ( I verified
that it has the correct value ).

The batch file contains a call to mysqldump.exe.

I can run the batch file manually and it works fine, however the
batch file will not execute through the php script as called from the
web interface I created for it.

On a side note If I make a call like this:

$Text = shell_exec("dir");
echo "$Text";

it works fine.

It seams to me like a permissions issue or some security configuration
that will not allow you to call batch files. I have been looking at
safe_mode but have not had any success.

Any ideas?

Thank you for your time!

Jan 15 '08 #1
3 2258
On Tue, 15 Jan 2008 18:22:52 +0100, <Ma*********@gmail.comwrote:
I am using php 5.2.5 via a wamp server on my machine. I have created a
web interface to a mysql database using php. The web interface has a
link to a php file which calls a dos batch file like this:

$Text = shell_exec("c:\mydatabase\convertdb.bat $Language");
If you use \\ or / instead of a single \ , does the problem persist?
--
Rik Wasmus
Jan 15 '08 #2
On Jan 15, 10:25 am, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Tue, 15 Jan 2008 18:22:52 +0100, <Mandrago...@gmail.comwrote:
I am using php 5.2.5 via a wamp server on my machine. I have created a
web interface to a mysql database using php. The web interface has a
link to a php file which calls a dos batch file like this:
$Text = shell_exec("c:\mydatabase\convertdb.bat $Language");

If you use \\ or / instead of a single \ , does the problem persist?
--
Rik Wasmus
using this did work!

$Text = shell_exec("c:\\mydatabase\\convertdb.bat $Language");

Thanks for the help!

Jan 15 '08 #3
Ma*********@gmail.com wrote:
On Jan 15, 10:25 am, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>On Tue, 15 Jan 2008 18:22:52 +0100, <Mandrago...@gmail.comwrote:
>>I am using php 5.2.5 via a wamp server on my machine. I have created a
web interface to a mysql database using php. The web interface has a
link to a php file which calls a dos batch file like this:
$Text = shell_exec("c:\mydatabase\convertdb.bat $Language");
If you use \\ or / instead of a single \ , does the problem persist?
--
Rik Wasmus

using this did work!

$Text = shell_exec("c:\\mydatabase\\convertdb.bat $Language");

Thanks for the help!
It's because shell_exec("c:\mydatabase\convertdb.bat $Language"); is
actually: c:mydatabaseconvertdb.bat
--
Daniel Ennis
faNetworks.net - Quality Web Hosting and Ventrilo Services
System Administrator / Web Developer
PHP Developer for 6 years
da****@fanetworks.net
Jan 15 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Mark C. | last post by:
I'm trying to call a batch file that I've built using the FileSystemObject and CreateObject("Wscript.Shell"), oShell.Run... in an asp script. Naturally, I can get the script to work from a command...
9
by: Doug at SAU | last post by:
I need to run a batch file on a remote machine from an ASP page. I dummied up a test ASP page as follows: <% Set WshShell = Server.CreateObject("Wscript.Shell") wshshell.run...
7
by: erniedude | last post by:
Hi, I'm a newbie and I was wondering if anyone knew a (Python) script to run 4 batch files, one after the other (assuming the directories are known). It would be better if all 4 batch files...
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
6
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
1
by: Charles | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
4
by: cryogeneric | last post by:
Hello everyone, :) I can't seem to get around some annoying permission issues when I attempt to run a quick test where I call a batch file from my ASP script. I'm running this on my XP Pro...
0
by: vasikaran | last post by:
Hi , i hava one ftp script in batch file programming , ftp script is working fine.. but my is i dont know how much files and what are files avaiulable in remote folder ,,,, if any errors or...
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.