idjuradj
idjuradj

Reputation: 1465

Batch file/command to start a program through command line

I have a program which I want to start using the command prompt and at the same time I want to pass 2 parameters to it. So, for example, when I wanted to start my program I would open the command prompt (in XP: start > run, type cmd, press return) and then type:

c:\rand\anotherfolder\myprogram.exe 10 20

Since I know nothing about batch files, I'm asking two things:

Upvotes: 2

Views: 2028

Answers (1)

Plymouth223
Plymouth223

Reputation: 1925

I'll edit this if you respond to my comment but if you want to simply execute this command via a batch file (and you know nothing about batch files):

  1. Open a text editor (e.g.Notepad)
  2. Type in your command (e.g. c:\rand\aotherfolder\myprogram.exe 10 20)
  3. Save the file as mybatchfile.cmd
  4. Double click the file (in Windows Explorer etc.)

Upvotes: 3

Related Questions