Powershell script to count file types

datafiend

New member
Local time
7:24 AM
Messages
1
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.

Code:
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
eption
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand"

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

Thanks again
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 64 BIT
CPU
XEON
Memory
16GB
Graphics Card(s)
NVIDIA

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Dual Boot: Windows 8.1 & Server 2012r2 VMs: Kali Linux, Backbox, Matriux, Windows 8.1
CPU
A10 7700 Kavari SteamRoller
Motherboard
ASUS A88XM-PLUS (FM2+ )
Memory
8GB DDR3 SDRAM PC3-8500
Graphics Card(s)
1024MB ATI AMD Radeon R7 Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Samsung
Hard Drives
SSD Crucial 120gb
WD VelociRaptor 1tb
PSU
Rosewill Gaming 650w
Case
Rosewill Galaxy 2
Internet Speed
55/12
Antivirus
Malwarebytes, MSE, SAS
Browser
FireFox, Chrome
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 Computer

Computer type
Laptop
Computer Manufacturer/Model Number
HP Elitebook 8540p
OS
Windows 7 Pro 32
CPU
Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
Motherboard
Hewlett-Packard 1521
Memory
4,00 GB (Usable 2,98)
Graphics Card(s)
NVIDIA NVS 5100M
Sound Card
NVIDIA High Definition Audio
Screen Resolution
1600x900
Hard Drives
INTEL SSDSA2CW120G3
Antivirus
F-Secure Internet Security
Browser
IE, Firefox, Opera
Other Info
Sandboxie,
SRP (Software Restriction Policy),
EMET (Enhanced Mitigation Experience Toolkit),
WFC (Windows Firewall Control by BiniSoft),
Malwarebytes Premium
Back
Top