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

file attributes

Closed Thread
 
Thread Tools Display Modes
Old 02-09-2007   #1 (permalink)
kbzsys@gmail.com
Guest


 

file attributes

I want to make a script which copies files that their archive-bit is
marked.
How can I find file attributes in PowerShell?

Old 02-09-2007   #2 (permalink)
ASCHNEIDER146
Guest


 

Re: file attributes

dir c:\ | fl FullName,Attributes

gives output like this

FullName : C:\Program Files
Attributes : ReadOnly, Directory

FullName : C:\andy4.csv
Attributes : Archive

You can filter like this

dir c:\ | where {$_.Attributes -contains "Archive"}

and then pipe this to copy-item

Andy Schneider



On Feb 9, 8:38 am, kbz...@gmail.com wrote:
> I want to make a script which copies files that their archive-bit is
> marked.
> How can I find file attributes in PowerShell?



Old 02-09-2007   #3 (permalink)
RichS
Guest


 

Re: file attributes

get-childitem | where{ $_.Mode -like "?a*"}

would do the job
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"ASCHNEIDER146" wrote:

> dir c:\ | fl FullName,Attributes
>
> gives output like this
>
> FullName : C:\Program Files
> Attributes : ReadOnly, Directory
>
> FullName : C:\andy4.csv
> Attributes : Archive
>
> You can filter like this
>
> dir c:\ | where {$_.Attributes -contains "Archive"}
>
> and then pipe this to copy-item
>
> Andy Schneider
>
>
>
> On Feb 9, 8:38 am, kbz...@gmail.com wrote:
> > I want to make a script which copies files that their archive-bit is
> > marked.
> > How can I find file attributes in PowerShell?

>
>
>

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
File attributes (getting/setting) and ownername Jacob Saaby Nielsen PowerShell 3 06-03-2008 08:52 AM
File Attributes Stuart Sabatini Vista General 2 05-17-2008 07:42 PM
File attributes in Vista tedmi Vista General 3 04-15-2008 03:11 PM
Vista Ultx64 - File Owner Attributes - Raging! jcuk General Discussion 0 03-19-2008 01:34 PM
How to get complete file attributes list on command line? Roof Fiddler Vista file management 1 09-28-2006 01:31 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