exe

Catch ERROR in EXE file if called from C# code

我只是一个虾纸丫 提交于 2019-12-13 09:24:05
问题 I am running an exe file from C# code, due to some reasons error occurs in that exe file. It keeps waiting and ultimately gives a popup error "abc.exe has stopped working" and so on, but it does not exit. //The below code is calling it successfully public bool callExe(string exePath) { Log("EXE excution Started : " + exePath, INFO_TAG); try { Process exeProcess = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = exePath; exeProcess.StartInfo = startInfo;

How to create exe file in qt designer with visual studio?

若如初见. 提交于 2019-12-13 08:40:43
问题 I create a qt application in visual studio. After building the project , the exe file not running and I have error message for missing a lot of dll files such as Qt5Core.dll and the others. How can I fix it? 回答1: let suppose your exe file name in MyApp.exe . copy MyApp.exe in a new folder. for example myfolder . open myfolder press shift and right click at myfolder's window in opened right click menu select Open command window here execute C:\Qt\Qt5.9.3\5.9.3\msvc2015_64\bin\windeployqt.exe

Running an executable command in Java with parameters?

时间秒杀一切 提交于 2019-12-13 07:46:09
问题 So i understand how to use the Runtime command in java pretty well to get an executable to run. My question is how would i code that to incorporate a parameter such as you would see in the target in a shortcut property, i.e. target: "C:......\notepad.exe" -w. In what way could I incorporate a parameter such as -w into the Java runtime command. 回答1: Use a ProcessBuilder and supply the necessary arguments to its constructor: ProcessBuilder builder = new ProcessBuilder("C:\\path\\to\\notepad.exe

Prevent an exe from being uploaded even after renaming its extention

走远了吗. 提交于 2019-12-13 07:25:24
问题 I am working on asp.net with c# . There is a file upload control in my form. Everything is working fine. The problem is that an .exe file can be uploaded by just renaming it. I would also like to restrict the size. 回答1: best way in your case is check the first bytes of the file to determine what they are. you should use FindMimeFromData function to determines the MIME type from the data provided. Have a look at this file signatures table and at this SO answer that shows you how get mime type

How to destroy an .exe file(not converted from py) by run as the same script

时光怂恿深爱的人放手 提交于 2019-12-13 05:49:29
问题 I have a script that runs an .exe file via subprocess.Popen() , but I just realized, that .exe file keeps running even I close my script. Is there any way to stop running an .exe file via name of it or ID? That exe file is not converted from a py file, so I'm stuck. 回答1: If you run process = subprocess.Popen(...) then you could terminate the process later using process.terminate() . If the subprocess may create its own children then process.terminate() and/or process.kill() might not be

Run an executable as service in C++

时光怂恿深爱的人放手 提交于 2019-12-13 04:47:12
问题 I created a Win32Console application using MSVS2013 and it was compiled successfully. Now I tried creating a service using CreateService and binary path was set to the path of the above produced executable. Though I was able to create the service, I cannot start it using StartService . The error code 1053 is thrown each time. I tried using sc.exe and also tried to start the service manually from Services . The same error is shown. How can I solve it now? 回答1: You must create a ServiceMain.

How to avoid prompt when EXE crashes

本小妞迷上赌 提交于 2019-12-13 04:45:11
问题 I am running an optimization algorithm in MATLAB and I am calling a Batch file (which calls an EXE file) to do a task for each iteration in MATLAB. I want this EXE to run and close before the code in MATLAB continues to the next iteration. So far I have made use of the START /WAIT commands in the Batch file and they work. Here is my example: @echo off @TITLE Ostrich - Optimizaton Software Toolkit REM Launch Ostrich,wait until it completes START /WAIT "OSTRICH" /MIN Ostrich.exe echo Done! >

c++ run .exe file with parameters

落花浮王杯 提交于 2019-12-13 04:45:10
问题 Im trying to run exe file with c++ with no luck I tried this: system("C:\\Program Files (x86)\\Counter-Strike Condition Zero 1.2 build 2771\\hl.exe"); How i can run hl.exe with parameters? Thanks Update: 'C:\Program' is not recognized as an internal or external command, operable program or batch file im getting this error. I tried system("C:\\hl.exe"); and it works good. I think problem is in whitespaces 回答1: You can run your executable with parameters by adding them to the end of hl.exe as

Exe to service possible?

人盡茶涼 提交于 2019-12-13 04:38:32
问题 Is it possible to have a .exe run as a windows service? 回答1: You can use a Windows app called SC.exe : http://support.microsoft.com/kb/251192 回答2: yes. cygrunsrv (cygwin) http://web.mit.edu/cygwin/cygwin_v1.3.2/usr/doc/Cygwin/cygrunsrv.README or INSTSRV/SRVANY (microsoft) http://support.microsoft.com/kb/137890 回答3: This works great in Windows: http://www.codeproject.com/KB/system/xyntservice.aspx JR 回答4: A paid app, Application as service does this as well. It has a GUI for adding, removing

Keyboard module gives overflow error when converting script to exe

本秂侑毒 提交于 2019-12-13 04:20:06
问题 I was trying to create a program to record keyboard keys using the keyboard module of Python. I want to create a standalone executable file for the program. So I used PyInstaller as well as other py to exe converters to convert my script to exe format but it always gives an Overflow Error on execution. Exception in thread Thread-1: Traceback (most recent call last): File "threading.py", line 916, in _bootstrap_inner File "threading.py", line 864, in run File "site-packages\keyboard\__init__