[Solved] Deleting files base on time creation [closed]

As it is clear in the example from where you have taken the code that fileList is a array of FileInfo. you have to declare and fill that array before code.: DirectoryInfo Dir = new DirectoryInfo(DirectoryPath); FileInfo[] FileList = Dir.GetFiles(“*.*”, SearchOption.AllDirectories); solved Deleting files base on time creation [closed]

[Solved] Delete specific subfolder under unknown folders from anywhere

I created a short powershell solution using this- $targetName=”ss s”; foreach ($file in Get-Childitem “G:\Project\Projects\” ) { $fname=$file.name; if (Test-Path “G:\Project\Projects\$fname\$targetName\”) { $shell = new-object -comobject “Shell.Application” $item = $shell.Namespace(0).ParseName(“G:\Project\Projects\$fname\$targetName”) $item.InvokeVerb(“delete”) } } This powershell script sends that folder to recycle bin after confirmation popup. (this won’t send any file named ‘ss s’) this seems … Read more