A
A
Anton Ku2015-04-06 06:52:46
cmd/bat
Anton Ku, 2015-04-06 06:52:46

Why won't a WinForms application run from the command line?

I have an application written in Managed C++ using WinForms. You need to run it with a bat file. After another ordinary change (changing the filter line in the file open dialog), launching via the command line began to lead either to the error "The application has stopped working, looking for a solution ...", or, on some machines, to a silent transition to the next line of the bat file after 2 seconds. Occurs regardless of the presence of arguments at startup. Similarly, when running through cmd.exe. The log created at startup in the first place does not have time to be created.
Launching by any other method (launching the .exe via Explorer, launching via a shortcut with arguments, launching via the task scheduler, launching the debugger) works correctly.
The version of the source code under which everything worked is lost.
Target platform .NET4.0, OS Windows 8.1 and Windows 7. The language of the systems is different, there is no Cyrillic in the path. Administrator mode has no effect. The systems and application have been tested in both Win32 and x64 versions.
What could be the reason for this behaviour?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Ku, 2015-04-06
@ieroglyph

I answered myself:
rely on
turned out to be a bad idea, since when called from the command line, the name of the executable file is passed as a null parameter without the full path to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question