topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 4, 2024, 5:33 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SOLVED: Quick PowerShell Question  (Read 5930 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
SOLVED: Quick PowerShell Question
« on: October 03, 2018, 01:16 AM »
I'd like to change the date of all files in a folder, recursively.

A PowerShell script I've found on the Internet to do this is:


$files =  Get-ChildItem -force -recurse | Where-Object {! $_.PSIsContainer}
foreach($object in $files)
{
     $object.CreationTime=("10 November 2016 12:00:00")
}


My question is:  Where would one place the folder to be acted upon?

The script above operates on the 'current' folder.  But I'd like to act upon a different folder from 'current.'

Example: C:\Files\*.*

If anyone knows of another 'command line' (i.e., batch file) way of doing the job, please share.

Thanks!

Nicholas Kormanik


highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
    • View Profile
    • Donate to Member
Re: SOLVED: Quick PowerShell Question
« Reply #1 on: October 03, 2018, 02:14 AM »
The answer is in the documentation?
https://docs.microso...em?view=powershell-6

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 554
    • View Profile
    • Donate to Member
Re: SOLVED: Quick PowerShell Question
« Reply #2 on: October 03, 2018, 02:53 AM »
Good link, highend01.  Explains what I need to know.

Skwire, mark this thread as closed.