r/windowsdev • u/Hachiman900 • Feb 23 '26
Launch application with environment variables set
I have a windows application written using c# and dotnet. I want to use dotnet's feature to generate dump of the application on crash. This feature works by setting some environment variables before launching the application.
So how do I have my application always launch with some evironment variables set regardless of how it is started (double-click icon in start menu, from task-scheduler, etc).
PS: I would like to avoid having another exe or script to launch the actual application with required environment variables set.
4
Upvotes
View all comments
Show parent comment
1
u/Hachiman900 Feb 23 '26
I did try this, but at this point it's too late. I need to start the process with the variables set for dotnet runtime to generate the dumps.