Pages

Monday, December 19, 2011

How to pass arguments to a Windows batch file?

You can pass an argument to Windows batch file (.bat) using %1 in the batch file.
Ex: echo %1

Then, in command prompt you need to give argument (ex: > test.bat Jay) This will replace %1 in the batch file.

This willl display "jay" in command prompt.

No comments:

Post a Comment