I am not sure if it's possible, i have kind of zero idea to create powershell script. it will be really helpful for me if someone can help me.
I have multiple sub folders, lets say
inside the folder there is multiple image files. i want to list the sub folder file name and size and save text files inside the folders.
filelist.txt will have something like this
here one sample script i found, wondering if some can help
I have multiple sub folders, lets say
Code:
C:\test\1
C:\test\2
C:\test\3
inside the folder there is multiple image files. i want to list the sub folder file name and size and save text files inside the folders.
Code:
C:\test\1\filelist.txt
C:\test\2\filelist.txt
C:\test\3\filelist.txt
filelist.txt will have something like this
Code:
logo.png 30kb
Header.png 4MB
here one sample script i found, wondering if some can help
Code:
$Folder = 'C:\pic'
$Output = 'C:\output.txt'
$Files = Get-ChildItem -Path $Folder -Filter *.mp4 -File
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($Folder)
foreach( $File in $Files ) {
$objFile = $objFolder.ParseName($File)
$Name = $objFolder.GetDetailsOf($objFile, 0)
$Size = $objFolder.GetDetailsOf($objFile, 1)
$Length = $objFolder.GetDetailsOf($objFile, 27)
$Tab = [char]9
"$Name$Tab$Size$Tab$Length" | Out-File -Append -FilePath $Output
}