Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - how to get subdir items with full path name?

Reply
 
Old 10-18-2006   #1 (permalink)
Benny


 
 

how to get subdir items with full path name?

I'm new to powershell,

How to get subdir items with full path name?


Thank you!


My System SpecsSystem Spec
Old 10-18-2006   #2 (permalink)
ClaudioG64


 
 

Re: how to get subdir items with full path name?


Benny ha scritto:

> I'm new to powershell,
>
> How to get subdir items with full path name?
>
>
> Thank you!


Some examples.

For a specific Path:
get-childitem C:\ | foreach-object -process { $_.FullName }

>From current directory and recursive:

get-childitem -recurse | foreach-object -process { $_.FullName }

>From current directory, including hidden files/dirs and recursive:

get-childitem -recurse -force | foreach-object -process { $_.FullName }

Ciao!
Claudio

My System SpecsSystem Spec
Old 10-18-2006   #3 (permalink)
dreeschkind


 
 

Re: how to get subdir items with full path name?

I just like to add that there are also some shortcuts that are not so verbose:



"ClaudioG64" wrote:

> For a specific Path:
> get-childitem C:\ | foreach-object -process { $_.FullName }


gci C:\ | % { $_.FullName }

> From current directory and recursive:
> get-childitem -recurse | foreach-object -process { $_.FullName }


gci -r | % { $_.FullName }

> From current directory, including hidden files/dirs and recursive:
> get-childitem -recurse -force | foreach-object -process { $_.FullName }


gci -r -fo | % { $_.FullName }

--
greetings
dreeschkind
My System SpecsSystem Spec
Old 10-19-2006   #4 (permalink)
Keith Hill [MVP]


 
 

Re: how to get subdir items with full path name?

"Benny" <DongDong.Wang@gmail.com> wrote in message
news:1161156839.805978.153610@m73g2000cwd.googlegroups.com...
> I'm new to powershell,
>
> How to get subdir items with full path name?


If you want just the name (ie a string object is OK) then just use:

gci . -name

or

gci . -recurse -name

Be aware that this will emit System.String objects instead of
System.IO.FileInfo/DirectoryInfo.

--
Keith


My System SpecsSystem Spec
Old 10-21-2006   #5 (permalink)
Jeffrey Snover


 
 

Re: how to get subdir items with full path name?

>I just like to add that there are also some shortcuts that are not so
>verbose:

Here is one for you:

${function:...} = { process { $_.($args[0]) } }

gci c:\ | ... fullname

Enjoy!

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How to get the full path for the PS1 itself? PowerShell
What's file's full path and BIOS Vista file management
Full path in the Address bar of Explorer??? Vista installation & setup
BUG/ANNOYANCE: PoSH autocompletes the full path rather than a minimal path PowerShell
full path versus ./filename PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46