I want to call diskpart.exe from my application (C# .net 4.8) to delete and reinitialize an attached storage device.
However, the user needs administration rights to do this.
However, I do not want to store an admin user with password in the application.
Is it somehow possible to authorize my program once to call diskpart.exe at any time?
I have already read on the internet that it is possible via a Windows Service or a Scheduled Task. However, both approaches have not worked for me so far.