Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Windows 2008 R2 Server. I used quota manangement in shared folder. My requirement is, whenever the limit is exceeded, .bat file should run.

My current batch file code is

@echo off
start "C:\scripts" xyz.exe

I want to open the exe file, whenever the quota limit exceeds.

I am new to scripting. I don't know how to pass command line arguments here.

Can anybody help me on this?

thanks in advance.

share|improve this question
can you please post your script? It is pretty much impossible to troubleshoot an unknown script... – August Sep 16 '11 at 11:20
code is only this much i ve written in bat file. ====================== @echo off start "C:\" xyz.exe %* ======================= – nalloo Sep 19 '11 at 3:52

To pass on all parameters to the script use %*

Like this:

@echo off
start "C:\scripts" xyz.exe %*


share|improve this answer

Ok if you are just trying to run the exe from the bat file then your bat file should just look like this inside:


If you want to pass parameters to the batch file then you can either do what Peter suggested (which I wasn't aware of so thanks Peter), or put each parameter individually in the batch file like so:

C:\xyz.exe %1 %2 %3

This will enable you to call the batch file like so:

xyz.bat param1 param2 param3

I put the params after the exe but you can put them wherever you need them to be in the bat file like so: (this example has the 1st parameter as the folder name, 2nd as the name of the exe, and 3rd as a param to pass to the exe).

C:\%1\%2.exe %3

You could call the batch file like so:

xyz.bat <folder name> <exe name> <parameter>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.