Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

how to get subdir items with full path name?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-18-2006   #1 (permalink)
Benny
Guest


 

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
Guest


 

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
Guest


 

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-18-2006   #4 (permalink)
Keith Hill [MVP]
Guest


 

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-20-2006   #5 (permalink)
Jeffrey Snover
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's file's full path and BIOS davidjchuang Vista file management 7 03-22-2008 11:22 AM
Vista search does not display path to items listed in results Saddlemountain Vista file management 2 12-04-2007 07:34 AM
Full path in the Address bar of Explorer??? Noozer Vista installation & setup 1 10-17-2006 09:03 PM
BUG/ANNOYANCE: PoSH autocompletes the full path rather than a minimal path Adam Milazzo [MSFT] PowerShell 2 08-12-2006 03:14 AM
full path versus ./filename Singee PowerShell 5 06-07-2006 03:27 AM


Vistax64.com 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 2005-2008

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 47 48 49 50 51