38 C
Dubai
Wednesday, August 17, 2022
spot_img

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

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here