1

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
exit

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.

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

2 Answers 2

1

To pass on all parameters to the script use %*

Like this:

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

Reference

1

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

C:\xyz.exe

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>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .