Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Powershell script to count file types

25 Mar 2015   #1

Windows 7 64 BIT
Powershell script to count file types

Hi all,
forgive me if this is the wrong folder.
I am googling scripts to find a PS script to count file types and files in several directory's on our network.
I am a noob on powershell, and I'm trying to experiment.
I have several directory's on my "Libraries" directory on my pc at work. I'm just trying to test a PS script to get this to work to count the files and list the file types in my "Libraries\Documents\Tidbits" folder.

Get-ChildItem \\hilltop3\users$\LongRandy\My Documents\TIDBITS
but I get this error:"Get-ChildItem : Cannot find path '\\hilltop3\users$\LongRandy\My' because it does not exist.
At line:1 char:14
+ Get-ChildItem <<<< \\hilltop3\users$\LongRandy\My Documents\TIDBITS
+ CategoryInfo : ObjectNotFound: (\\hilltop3\users$\LongRandy\My:String) [Get-ChildItem], ItemNotFoundExc
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand"

How can I put in the ENTIRE file path? It just arbitrarily truncates the path?

Thanks again

My System SpecsSystem Spec
25 Mar 2015   #2

Dual Boot: Windows 8.1 & Server 2012r2 VMs: Kali Linux, Backbox, Matriux, Windows 8.1

You may find someone qualified for answering this here but your best bet is a place like this
My System SpecsSystem Spec
25 Mar 2015   #3

Windows 7 Pro 32

As a general rule when supplying parameters to any program: add quote signs around it if it contains space characters

"\\hilltop3\users$\LongRandy\My Documents\TIDBITS"

A space character is the universal separator for parameters, so in your case, without quotes, the program thinks you're supplying 2 parameters:
1. \\hilltop3\users$\LongRandy\My
2. Documents\TIDBITS
My System SpecsSystem Spec


 Powershell script to count file types

Thread Tools

Similar help and support threads
Thread Forum
CMD or Powershell Moving - script not working
set LISTFOLDER=D:\List\ set FILESPATH=D:\Igre\COD-MW2\main\images set DESTPATH=D:\Igre\COD-MW2\main\images\thepit REM for /r %LISTFOLDER% %%I in (*.txt) do echo xcopy /qvs "%FILESPATH%\%%~nxI" "%DESTPATH%%%~pnxI" for /r %LISTFOLDER% %%I in (*.txt) do xcopy /qvs "%FILESPATH%\%%~nxI"...
General Discussion
powershell script to create user folders and set permissions
Wondering if anyone in this forum can help me figure out what I am doing wrong with my script. I am grabbing a text file with a list of users in it. I want to then create folders for all those people and then set explicit permissions on those folders to only allow the users and admin access to it....
Display File Extension on Unknown File Types
Hello :o I dont know if Im on the right section to post this. I just want to ask to our fellow members and gurus here, I dont know what went wrong but suddenly the unknown file types in my Windows 7 PRO x64bit doesnt display its file extensions anymore.. How can i restore it to default? to...
General Discussion
PowerShell logon script
Ok, so this doesn't necessarily have to do with Windows 7, but I originally wanted to reply to a post on Vista forums and somehow I ended up here. Anyway... I actually tried all of this on Windows Server 2008 - set policies, scripts and logged on there. Here's one way that actually works. 1)...
Network & Sharing
I can't sort by File Types. What happened to File Details?
When I do a search on how to sort, I get a Tutorial that tells me to open the "View" Menu item. However, as you can see from the attached, I don't have a VIEW menu on my Folder. I would like to sort these by file type so that I can save them to a CD. What am I doing wrong here?:(
General Discussion
Windows 7 File Count
I need a little help from someone who has downloaded newer Windows 7 images... I have these builds: Build 6801: 751 Files, 147 Folders Build 7000: 793 Files, 150 Folders Build 7048 (x64): 811 Files, 157 Folders
Chillout Room

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:41.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App