Jump to content

Recommended Posts

Posted

Managed to find the following script to give me a rough idea of what to archive over the summer 'holidays'....

 

Get-ChildItem -Path E:\Staff$ -Recurse | Select-Object FullName, LastWriteTime , LastAccessTime, Length | Export-Csv -Path C:\Reports\folderage.csv -Encoding ascii -NoTypeInformation

 

Although it completes, it is giving me quite a few errors (some access denied which I will look into) but most complaining about long path names!

 

TOO LONG.jpg

 

Is there any 'SIMPLE' way around this (bearing in mind I cannot code)?

 

It's not even giving me enough information to find out where these folders are....

Posted

Install NTFSSecurity PowerShell module.

 

Install-Module -Name NTFSSecurity

 

Then run...

 

[color="#FF0000"]Get-ChildItem2[/color] -Path E:\Staff$ -Recurse | Select-Object FullName, LastWriteTime , LastAccessTime, Length | Export-Csv -Path C:\Reports\folderage.csv -Encoding ascii -NoTypeInformation

 

Get-ChildItem2 can cope with long file paths.

  • Thanks 1
Posted (edited)

From memory if you are using wps 5.1 or later do the following

Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1

 

That should fix the std cmdlet

Edited by HPlum78
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...