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

x
  • 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?
0
stevehibbert
Asked:
stevehibbert
3 Solutions
 
gtworekCommented:
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.
0
 
alb66Commented:
On the same machine or on a different machine?

On a different machine may be you need to install the visual c runtime libraries
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
0
 
js-profiCommented:
"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.
0
 
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.
0

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