473,387 Members | 1,540 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,387 software developers and data experts.

how to invoke a bat file from php by passing parameters on windows

hello everyone..... i am ajay and i am new to php. in my project i have an option to invoke a bat file by passing parrameters and to diplay the result.

i tried this code but my page got hung or display nothing...

exec("c:\collabland\collabland.bat $distcode $tlkcode $villacod $block $svno");

here by passing this parameters to collabland.bat, a sketch will be generated based on the parameters and it should be displayed. when i type in command promt it is working. but not in php. i want to pass the parameters to bat file and based on the values generate the sketch and display it in my php project. i am using windows xp. i am passing the values in button click.

please suggest a solution .

thanks for spending your valuable time.
Jan 31 '08 #1
3 4478
harshmaul
490 Expert 256MB
Hi Ajay,
Quick question to help me diagnose better,
Is the bat file on the client machine or the server?

I'm only asking to make sure your not tring to run a bat file thats on the client from the server, as that isn't possible.
Jan 31 '08 #2
Hi Ajay,
Quick question to help me diagnose better,
Is the bat file on the client machine or the server?

I'm only asking to make sure your not tring to run a bat file thats on the client from the server, as that isn't possible.
hi harsh....

my bat file is on the client side.....ie my bat file is on the c: folder and i am using dreamweaver for my php coding and my php is also saved in c: folder.
Feb 1 '08 #3
harshmaul
490 Expert 256MB
Hi,
This is one way to do it....


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. header("Content-type: application/bat ");
  3. header("Content-Disposition: attachment; filename=mybat.bat");
  4. ?> 
  5. dir/s
and obviously change the dir/s to the batch commands.

You can't directly open files on a client from a server.
Feb 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Neil Fedin via .NET 247 | last post by:
I am writing a testing application that uses reflection to open assemblies and call methods. I have a function that looks like this... public void Method1 (int IDArray, bool SomethingElse){...
2
by: Martin Maat | last post by:
Hi, I am trying to create a plug-in assembly without the need to register it in the GAC. Reflection should help me out here. I got this far: private void button1_Click(object sender,...
0
by: KK | last post by:
Hi MCPP gurus' I have a small problem in parameter passing.This is my situation namespace Abc { public __gc class ClassAbc { public: String* Hello(String* str) {
14
by: stic | last post by:
Hi, I'm in a middle of writing something like 'exception handler wraper' for a set of different methodes. The case is that I have ca. 40 methods form web servicem, with different return values...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
4
by: Charles Law | last post by:
Hi guys. I have two threads: a main thread and a background thread. Lots of stuff happens in the background thread that means I have to update several (lots) of controls on a form. It is...
2
by: John Lutz | last post by:
Our app is mainly COM based. We allow .NET plug-ins. When a plug-in is installed, it receives a COM pointer to the app. The plug-in implements our IExtensionImpl interface and gets the app...
1
by: massdeletion101 | last post by:
It's meant to make making Windows for the API quiker and easier, but one of the problems is that in order to properly create a window with a create window function, needs to know about the Windows...
0
by: palomino100 | last post by:
Hello! I set my setup project to run directly from Windows Explorer the files of my application. Now i can only select the files one by one and passing them separately as a parameter in my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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...

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.