Tuesday , December 12 2017

Removing Large File structures using PowerShell

Open Powershell Run as Administrator. Browse to the Location to be Safe.

image

Get-ChildItem -Recurse | Remove-Item -recurse -Confirm:$false -Force –verbose

image

Now File Structure under Junk folder and its subfolders is Removed without any confirmation.

If you get into this below error –

The Specified Path , File Name or Both are too long. The Fully qualified file name must be less than 260 Characters, and the directory name must be less than 248 Characters

image

Now in this case use Robocopy nothing need to be installed on Latest windows Machines.

Create a Empty Folder

image

Now ask robocopy to Mirror this empty folder to the destination folder.

robocopy /MIR c:\S C:\Junk

Now File Structure under Junk folder and its subfolders is Removed without any confirmation.

image

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Exchange Server MVP , Publisher of CareExchange.in Supporting/Deploying/Designing Microsoft Exchange for some years. Extensive experience on Microsoft Technologies.

Check Also

Enable Password Write back on existing Azure AD Connect

By Default Azure AD Connect synchronizes password one way only , From On-Premises to Cloud ...

Leave a Reply

Your email address will not be published.