How to execute c# console application from batch file

Go To StackoverFlow.com

0

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: http://stackoverflow.com/questions/221730/bat-file-to-run-a-exe-at-the-command-promp - 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


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 ...

2012-04-04 07:21
by Joey


2

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

2012-04-04 07:20
by PraveenVenu


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.

2012-04-04 07:27
by shenhengbin
Ads