[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Visual C++, How to create a Windows App you can launch from DOS and Windows

I am writing an interactive Windows program to load a text file to a database.  I am writing the app to run in both interactive and 'automatic' modes, so that I can schedule a regular file upload.
I would like to be able to trigger the app in automatic mode from a DOS shell, so that I can include it in batch files.  This would be similar to launching Notepad.exe from the DOS prompt.
The current build of the app will not trigger from DOS, I get "The system cannot execute the specified program".
What do I need to do to make the Windows app launchable from a DOS shell?
3 Solutions
Do you mean DOS? Or commandline from the same OS you launch your app by double clicking it.
If it is the same OS then your app should working normally.
This must work... :)
Did you change the path to app folder (cd some_path command)?
Did you try to launch your app using start command? "start yourapp" in commandline.
On the same machine or on a different machine?

On a different machine may be you need to install the visual c runtime libraries
"the system cannot execute the specified program" means that the execution of your prog crashes. any .exe could be started from a NT command window (DOS-Box). If you have a console program (project type Win32-console application) it would use the same command window for output and not open a new window.
stevehibbertAuthor Commented:
This was an error in my code, I've just found out, and "js-profi" is correct.
"alb66" is also right about installing the C-runtimes, but I statically linked, so the runtime stuff is contained in the exe.  "gtworek" gives good hints about checking what you're doing to remove numpty errors, and it turns out that this was a error of that kind.

Thanks very much for the replies, but I think js-profi gets the points here.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now