473,400 Members | 2,163 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,400 software developers and data experts.

dos batch file execution

Has anyone done this? A windows webserver has a share on the same
computer that contains some dos batch files. I'm trying to write a
php page that will execute them. After much thrashing around and
searching I'm still not getting any results.

I've tried
echo exec('t:\dir\batch.bat');

as a starting point.

Can anyone point me in the right direction please?

Hughie

Nov 25 '06 #1
3 2427
"hughie" <hu************@gmail.comwrote:
>Has anyone done this? A windows webserver has a share on the same
computer that contains some dos batch files. I'm trying to write a
php page that will execute them. After much thrashing around and
searching I'm still not getting any results.

I've tried
echo exec('t:\dir\batch.bat');

as a starting point.
The problem is probably the "t:", not the batch file. The webserver runs
as a service, under a separate user name, that does not have access to your
net shares.

Try writing it as a UNC: \\server\share\dir\batch.bat.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 26 '06 #2

Tim Roberts wrote:
Try writing it as a UNC: \\server\share\dir\batch.bat.
echo system("\\server\share$\dir\batch.bat arg1");

or

echo exec("\\server\share$\dir\batch.bat arg1");

both don't return anything.

now playing with adding "cmd /c " before my string.

Nov 27 '06 #3

I now believe this is a permission issue. php running on windows under
an IUSR account probably without permissions to access cmd.exe (which
is good!).

Nov 28 '06 #4

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

Similar topics

2
by: den 2005 | last post by:
Hi Everybody, Is anybody knows how to Hide Execution of batch file at background? I mean without displaying the DOS Prompt window while batch file is being executed. I used code below to execute...
3
by: KRK | last post by:
I am having one batch file and using this I can start my Server. It will execute all exes while starting. Now my question is how to debug my exe using this batch file?? Is it possible to execute this...
2
by: DB | last post by:
Hi All, I have to execute dos command containing batch file using asp.net application. Code for batch file execution is working properly when I tried it with console application but same code...
3
by: JoelBrimm | last post by:
I have a batch file that executes a command line utility to do a secure file copy from our server to a 3rd party server. The batch file works fine, but when I call it from the web service the log...
1
by: brianbasquille | last post by:
Hello all, Hope you can help me with this little conundrum! I'm running a batch file and want to print the execution of it line-by-line. Best reference i could find was:...
7
by: rhjaisingh | last post by:
Folks, I need to create a batch file that will do the following - Establish a DB2 instance Connect to a certain database Get data using an sql and output it to a file So, this is what I...
0
by: ee_stevek | last post by:
hi guys, here is my problem: i have to maintain a web vb.net application developped some times ago. The application was developped on Windows2000 SP3 with Visual Studio 2003 (7.1). and the...
4
by: ed | last post by:
Hi all, I'm very new to vb (2nd day) and I need to create a small app that will replace my old batch file with a flashy gui. I had some experience with access 2.0 which helps ;) What I would...
4
ck9663
by: ck9663 | last post by:
hi guys this is a little challenging, at least for me...here goes... i have to run a DOS batch file from a server. with some parameters that i need to pass. these parameters can be found on a...
2
by: abhaybhat | last post by:
I run a batch file, which is nothing but a make file of my project. It also does linting for me. Hence the execution of the batch file in the DOS window can be seen, which is very huge(i have...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.