1

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.

3
  • Console application is like usual exe files, you can use "Call ConsoleApp.exe" ConsoleApp will be your application name Commented Apr 4, 2012 at 7:21
  • This thread discussed on the same: stackoverflow.com/questions/221730/… Commented Apr 4, 2012 at 7:26
  • 2
    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#). Commented Apr 4, 2012 at 7:50

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.