I'm trying to run the .exe through a bat file, #865

Closed
opened 2026-01-29 16:50:43 +00:00 by claunia · 5 comments
Owner

Originally created by @mikefz010182 on GitHub (Apr 2, 2023).

Originally assigned to: @GregorBiswanger on GitHub.

Hello everyone, I have an .exe with interface and I want to run it from a bat file from my cmd command list, my .exe file has two text boxes:
Source File
Clue
I want to pass these two parameters through my bat file so that it is executed automatically, someone at some point has done something related or would have some ideas on how I could do it, greetings to all.

image

when executing my bat file it only opens the program but does not pass my parameters to my interface of my .exe

image

Originally created by @mikefz010182 on GitHub (Apr 2, 2023). Originally assigned to: @GregorBiswanger on GitHub. Hello everyone, I have an .exe with interface and I want to run it from a bat file from my cmd command list, my .exe file has two text boxes: Source File Clue I want to pass these two parameters through my bat file so that it is executed automatically, someone at some point has done something related or would have some ideas on how I could do it, greetings to all. ![image](https://user-images.githubusercontent.com/118303842/229374307-5a2e4a85-cf97-4cd9-8466-dd7e3c6a33be.png) when executing my bat file it only opens the program but does not pass my parameters to my interface of my .exe ![image](https://user-images.githubusercontent.com/118303842/229374188-a22d2087-1c26-4a2d-92b4-cce75d0d41cc.png)
claunia added the question label 2026-01-29 16:50:43 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Apr 3, 2023):

Our API leans towards the capabilities of the native Electron. Support for parameters with the native Electron works via command line switches. https://www.electronjs.org/docs/latest/api/command-line-switches

I'll show you how to use the command line switches with Electron.NET here:
https://github.com/ElectronNET/Electron.NET/issues/337#issuecomment-559904002

@GregorBiswanger commented on GitHub (Apr 3, 2023): Our API leans towards the capabilities of the native Electron. Support for parameters with the native Electron works via **command line switches**. https://www.electronjs.org/docs/latest/api/command-line-switches I'll show you how to use the **command line switches** with **Electron.NET** here: https://github.com/ElectronNET/Electron.NET/issues/337#issuecomment-559904002
Author
Owner

@GregorBiswanger commented on GitHub (Apr 3, 2023):

Please let me know if the solution helped.

@GregorBiswanger commented on GitHub (Apr 3, 2023): Please let me know if the solution helped.
Author
Owner

@mikefz010182 commented on GitHub (Apr 3, 2023):

image
Hi GregaroBiswanger, I'm trying but I'm still stuck with the new script you sent me, I don't know if I'm applying the syntax correctly

image

@mikefz010182 commented on GitHub (Apr 3, 2023): ![image](https://user-images.githubusercontent.com/118303842/229578930-4992f2a2-844d-465a-8e52-a22505e1cea3.png) Hi GregaroBiswanger, I'm trying but I'm still stuck with the new script you sent me, I don't know if I'm applying the syntax correctly ![image](https://user-images.githubusercontent.com/118303842/229579290-3afb50a2-0a1c-4acd-aa33-fa71efcb3eeb.png)
Author
Owner

@FlorianRappl commented on GitHub (Apr 3, 2023):

Hm - you write JavaScript in a bat file...

Again, follow the steps outlined in the referenced issue:

  1. Add the args to the call of the exe (e.g., myapp.exe /args --dog=woof --test=true)
  2. You'll need a JS file run inside the electron application - this way you can call, e.g., app.CommandLine.HasSwitchAsync where app is the global application imported from the electron package

The (2) can also be read / achieved inside Electron.NET. The API has the CommandLine object that exposes the functionality from the app.CommandLine object.

@FlorianRappl commented on GitHub (Apr 3, 2023): Hm - you write JavaScript in a bat file... Again, follow the steps outlined in the referenced issue: 1. Add the args to the call of the exe (e.g., `myapp.exe /args --dog=woof --test=true`) 2. You'll need a JS file run inside the electron application - this way you can call, e.g., `app.CommandLine.HasSwitchAsync` where `app` is the global application imported from the `electron` package The (2) can also be read / achieved inside Electron.NET. The API has the `CommandLine` object that exposes the functionality from the `app.CommandLine` object.
Author
Owner

@FlorianRappl commented on GitHub (Nov 1, 2025):

Outdated - use ElectronNET.Core and ElectronNET.Core.AspNet.

See Wiki / What's New.

@FlorianRappl commented on GitHub (Nov 1, 2025): Outdated - use `ElectronNET.Core` and `ElectronNET.Core.AspNet`. See [Wiki / What's New](https://github.com/ElectronNET/Electron.NET/wiki/What's-New).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#865