22 C
Dubai
Wednesday, December 18, 2024

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
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?