Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
Gregory Diebold
49 discussion posts
can Application.Start pass parameters to an .exe?

[see attachment]
  • In Red, the first line WILL launch Edge Browser.
  • But, the second line, with a parameter, fails to even launch Edge on Win 11. Tried with just a URL,too, but no launch.


  • In Green, I was able to get Edge to launch with parameters. Here, Edge is spawned with three distict tabs.

Is there a better way?
• Attachment [protected]: .Proc.png [29,787 bytes]
Dec 14, 2023 (modified Dec 14, 2023)  • #1
User Image
Gregory Diebold
49 discussion posts
UPDATE: I added in a Stringbuilder for easy maintainance later. Suggestion welcome.....
• Attachment: .Proc2.png [55,324 bytes]
.Proc2.png
.Proc2.png
Dec 14, 2023 (modified Dec 14, 2023)  • #2
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You can pass command line params as a string to BFS.Application.Start, like this:

BFS.Application.Start(@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", "https://www.displayfusion.com")
Dec 14, 2023 (modified Dec 14, 2023)  • #3
User Image
Gregory Diebold
49 discussion posts
Nice! Modified for ease of maintainance, since I will be adding/removing sites later. What's the @ for?

  • BFS.Application.Start(@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", strParms.ToString());
Dec 14, 2023  • #4
User Image
Gregory Diebold
49 discussion posts
Modified again to use an array instead of stringbuilder. They both work identical as far as output, but this was for maintainance & C# refresher (Been VB'ing ASP.NET for 15 years).
• Attachment: 2023-12-15_07-31-21.png [28,998 bytes]
2023-12-15_07-31-21.png
2023-12-15_07-31-21.png
Dec 15, 2023 (modified Dec 15, 2023)  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
The @ treats the string in the quotes as literal, so that you don't need to escape the backslashes. e.g. You can do either
"C:\\Program Files\\blah.exe"
or
@"C:\Program Files\blah.exe"
Dec 15, 2023  • #6
User Image
Gregory Diebold
49 discussion posts
ok, same as VB. Yea, the "\\" insertions are a pain. I learned years ago never to assume anything until its verified.
Dec 15, 2023  • #7
User Image
Gregory Diebold
49 discussion posts
For Keith.....suggestions welcome.
• Attachment [protected]: MENU.png [323,976 bytes]
Dec 15, 2023  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Looks pretty clean to me!
Dec 18, 2023  • #9
User Image
Gregory Diebold
49 discussion posts
I noticed that when going back to edit a .Start path that the application list does not pop-up on <Enter>. I tried <ctrl-space> but it shows itellisense entries, not the application list.

Is there a workaround for this? The one I found is to create a new script, where the list pop-up, and copy/paste that path from there.
• Attachment: start intellisense.png [16,055 bytes]
start intellisense.png
start intellisense.png
Dec 19, 2023 (modified Dec 19, 2023)  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
There isn't a way to manually invoke those helper popups, no. The only way currently would be to delete the whole line and start it again.
Dec 20, 2023  • #11
User Image
Gregory Diebold
49 discussion posts
That did work IF I started over on a different line. This is such a low-priority item I hate to even mention it, but my testing shows the best consistant technique that works every time (so far) is to:

- backspace over the .Start and enter the . to invoke intellisense.
- Scroll down the list and the dbl-click on Start. Enter usually doesn't work, unless I started on a different line.
• Attachment: 2023-12-20_14-23-21.png [44,599 bytes]
2023-12-20_14-23-21.png
2023-12-20_14-23-21.png
Dec 20, 2023  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Yep, that's usually how I work around it too now that you mention it, I forgot that works as well :)
Dec 20, 2023  • #13
User Image
Gregory Diebold
49 discussion posts
I've read some of your other threads and it's impressive how much you remember on many different topics. Looked over some of the custom scripts to download....creative solutions.
Dec 20, 2023  • #14
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Thanks for the kind words! :)
Dec 21, 2023  • #15
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)