I have the sample console application which is supposed to be executed in the startup task, i want to execute the console application through batch file, please can i know the right syntax to execute it.
Asked
Active
Viewed 9,110 times
1
-
Console application is like usual exe files, you can use "Call ConsoleApp.exe" ConsoleApp will be your application name – Kiru Apr 04 '12 at 07:21
-
This thread discussed on the same: http://stackoverflow.com/questions/221730/bat-file-to-run-a-exe-at-the-command-prompt – Prakash Apr 04 '12 at 07:26
-
2Why exactly is the question downvoted? It's clearly stated and it's unreasonable to expect any sample code in this case. I remember having the exact same problem some 21 years ago (well, not with C#). – Jacek Gorgoń Apr 04 '12 at 07:50
3 Answers
5
"C:\Users\mahesh\Documents\Visual Studio Projects\Foo\bin\Debug\Foo.exe"
Foo
Foo.exe
"\Some other folder\foo"
would all be possible options how to execute it, depending on where the program resides and what your current working directory is ...

Joey
- 344,408
- 85
- 689
- 683
2
just put the full path of the console application .exe file in the batch file.

PraveenVenu
- 8,217
- 4
- 30
- 39
1
In my project .
Folder is like
D:\Run
│ main.bat >> your batch file
│
└─Test
│
│
└─your application
Content of the bat file is like
cd /d %~dp0test\
Checker.exe>check.log
The first line
cd /d %~dp0test\
is replace the runtime directory to the full path of the appliction file.
>check.log
Is an option to output the log file.

shenhengbin
- 4,236
- 1
- 24
- 33