How to execute c# console application from batch file

Go To


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.

2012-04-04 07:18
by mahesh
Console application is like usual exe files, you can use "Call ConsoleApp.exe" ConsoleApp will be your application nam - Kiru 2012-04-04 07:21
This thread discussed on the same: - Prakash 2012-04-04 07:26
Why 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ń 2012-04-04 07:50


"C:\Users\mahesh\Documents\Visual Studio Projects\Foo\bin\Debug\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 ...

2012-04-04 07:21
by Joey


just put the full path of the console application .exe file in the batch file.

2012-04-04 07:20
by PraveenVenu


In my project .

Folder is like

│  main.bat  >> your batch file
    └─your application

Content of the bat file is like

cd /d %~dp0test\

The first line

cd /d %~dp0test\

is replace the runtime directory to the full path of the appliction file.


Is an option to output the log file.

2012-04-04 07:27
by shenhengbin