I'm creating a launcher using electron. It launches applications and files in my Windows system using the shell.openExternal command.
It works well when I call shell.openExternal passing .lnk shortcuts as parameters, but when I call some apparently equal shortcuts created by, for example, GoG installers, the game is not launched and I can't debug what happens. I know that the shortcut is called but the target application crashes. I got this message from Lichdom: Battlemage launcher:
Witcher 3 also fails, nos message is displayed. When I call these shortcuts directly from the system, they work fine. If I manually create an apparently exact same shortcut to the same file, it launches normally in both electron and the explorer.
Any ideas what could be happening or how to debug?
Related
I have a webjob that I'm debugging locally as a console app. But once I stop the code from within VS2017 I'm unable to recompile the exe as I get the following error
Unable to copy file "obj\Debug\******.******.exe" to "bin\Debug\******.******.exe". Access to the path 'bin\Debug\******.******.exe' is denied.
When I look at the processes that are running theres nothing there that jumps out.
I've closed VS and restarted it, but thats not cleared the issue.
Other than restarting my machine is there anything else I can try?
You can use the Windows Resource Monitor tool. Once opened, navigate to the CPU tab and enter the full path of the .exe (e.g. C:\Project\bin\debug\App.exe) in the Search Handles text box in the bottom-mid right corner and search. You should see the list of processes currently locking on the particular resource (in this case, the .exe). Select all the unwanted processes, right-click and end process. Depending upon on the version of Windows you are running, the experience might differ a bit but the general idea is more or less the same.
My Electron app shows files inside their enclosing folder using the standard command shell.showItemInFolder(fullPath). Works.
Now when two Windows users are signed in and they both use the app, the file is always shown on the Windows desktop of the user opened the app first.
In real life, it looks as if the function is broken, but actually the Windows Explorer is simply opened in the other Windows user's session in the background.
Does anyone know how to get rid of this problem?
I have a windows application with user Interface that do some stuff...
Now my client wants that, when he pushes the power button MyApplication run before he forced to input the username and password!
comment: the system is multi user on windows XP or Seven.
Is it possible anyway?
I found the way to do this was to create a scheduled task with a trigger for "on startup". This starts the application before windows logon. This is particularly useful in a server type environment if you need to have something run that is not a service.
It is simple. The process is.
Run gpedit.msc
Go to computer Configuration -> Windows Setting -> Scripts(Startup/shutdown)
Go to Startup properties then you will get the new windows.
Now add the program that you want to run before login.
The right way to do this is to implement a Windows service.
I've used this article here as I run a Minecraft server which I need to have the console interactive so I can manage the server and running it as a service is not a good solution in such a case: https://www.tenforums.com/tutorials/138685-turn-off-automatically-restart-apps-after-sign-windows-10-a.html
What I did was edit the registry:
Go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Create a new DWORD value (if this DWORD doesn't exist already) and
call it RestartApps with the value of 1
This now starts apps that usually startup before you log in and starts the programs in shell:startup
You can not run an exe without first loading the operating system. You can, however, run the exe without logging in first. Just add copy and paste the shortcut for the exe into C:\Documents and Settings\Administrator[or other user name]\Start Menu\Programs\Startup. Then check msconfig to make sure your exe is checked to run on startup.
I am working with an API within my own C++ program that communicates with a 3rd party application of the API through a server -client relationship of a TCP connection. At this time, I have to manually open the server console application (.exe) first, followed by the client console application (also .exe). Both these windows must remain open in the background throughout my application in order to perform the necessary tasks.
I would like to automate the execution of these two .exe's in the order that I have presented above. I have tried two consecutive ShellExecute() Windows API function calls, I have tried the old system() function and I have tried opening a batch file like this:
ShellExecute(NULL,"open","ocrtext.bat",NULL,NULL,SW_SHOW);
Where the batch file goes something like this:
START c:\videoocr\server\ocrD.exe
START /w c:\videoocr\server\ocrGW.exe
The same problem exists with all these options: The server console window opens fine, but the client window fails to open. I suspect that the problem has to do with an inability to call multiple console applications that each stay open with these methods.
What can I do? Thank you in advance.
call the application in your batch file with this command:
start "App1" /min cmd.exe /c startApp1.exe
start "App2" /min cmd.exe /c startApp2.exe
...
With this a batch file can open different consoles.
I have a QT application. When I use my created application launcher to start it, it doesn't work.
However, if I go to terminal and run the application from there, it works.
I'm wondering what their differences are.
Thanks.
Maybe your application launcher doesn't contain the right command and environment?
How is your launcher trying to start the program? Are any errors being reported?
It could be that the current directory is not set as expected. Or the command line parameters being sent aren't formatted correctly. Hard to say without seeing some code or an error message.