In C#
I am attempting to delete the same folder for any user that uses my app. I tried every wildcard and Visual studio does not like it. In Powershell works without problem, the issue here is not all users can use the script in admin mode.
My current code:
Directory.Delete(@"C:\Users\*\AppData\Roaming\Microsoft\Teams", true);
What I am attempting to delete is in the Roaming folder of windows and the folder is called "Teams" I am unsure how to code this to work on any user.
Ive tried: Directory.Delete(Environment.SpecialFolder.ApplicationData + "\\Teams");
I get feedback telling me it cannot find it. I even tried the Microsoft method: Directory.GetDirectories()
I am unable to get a sample of code that shows how to utilize it.