Hello! I am currently working on a software that will delete some junk on my PC, stuff that I normally delete manually but since I can do it automaticlly why not right?
I usually delete everything in my temp folder.. That is if you hit the Windows Key + R and type %temp% and then I delete everything there.. The thing is, I was talking over this with a friend of mine and we agreed on something like this might work
System.IO.DirectoryInfo di = new DirectoryInfo("YourPath");
foreach (FileInfo file in di.GetFiles())
{
file.Delete();
}
foreach (DirectoryInfo dir in di.GetDirectories())
{
dir.Delete(true);
}
But the thing is, he wanted me to send him the software once im done..
And lets say I change the YourPath to the exact path on my computer it wont work on his because lets say mine is
C:\Users\Dev\AppData\Local\Temp
He might have a different name on his PC..
So my question is..Is there a way I could bring up maybe the CMD when a button is being pressed or is there a short code for accessing the temp files in the .NET library?
What I have tried:
I've tried looking over some examples on StackOverflow but nothing that applied to my situation.. And yes I am well aware of CCleaner