# How to write a batch file in Windows?

Hi,
I would like to write a batch file in Windows to run the following commands
xyz.bat -u A \\some\path\in\here\somefileName.bat -v
cd \\to\a\directory\given\as\an\input\to\the\batch\file

xyz.bat -u A \\run\a\perl\file\inhere\fileName -option A -option B


As I mentioned in the sudo code above, the directory that I want to cd to will be given as an input to the batch file.

Also, the following part will also be an input the to batch file:

\\run\a\perl\file\inhere\fileName


The options will not be an input. They will be hard coded in the batch file.

so basically the sudo code can also be summarized like this:

xyz.bat -u A \\some\path\in\here\somefileName.bat -v
cd $directory xyz.bat -u A$file -option A -option B


Can you please tell me how I can write this code?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
instead of $directory and$file, the parameters come in as %1 and %2.

just use %1 and %2, and the parameters will go in as typed

xyz.bat -u A \\some\path\in\here\somefileName.bat -v
cd %1

xyz.bat -u A %2 -option A -option B
0

Experts Exchange Solution brought to you by