INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Listing files by attribute

Listing files by attribute

(OP)
Hi

This seems to be a VERY quiet forum, but let's see if this query gets any bites anyway.

Some background first:

There's a feature of DFS which prevent replication of files that have the temporary attribute set.

That's fine, but some of our files which aren't actually temp files have got this temporary attribute set, thus causing us an issue.

To fix this, this Microsoft article suggests running the following Powershell command:

CODE --> Powershell

Get-childitem D:\Data -recurse | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}} 

Nice, BUT, I first want to list these files so I can make a decision for myself as to which ones are/are not temporary (since it's possible there will be "~roposal.doc" files, or *.tmp files).

As I'm very new to Powershell I'd like some help with editing this command so that instead of changing the attributes of the files it finds are 'temporary' it merely lists them.

So, help, please!

JJ
Variables won't. Constants aren't
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast...and so on)

RE: Listing files by attribute

CODE --> PowerShell

Get-childitem D:\Data -recurse | ? {$_.attributes -band 0x100 -eq 0x100} 

Should list them out, although I haven't tested that.

Do you have your Tek-Tips.com Swag? I've got mine!

Stop by the new Tek-Tips group at LinkedIn.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close