Erwin Pombett
asked on
with powershell : how can i create a file with a creationtime older that today ?
Hello,
i'd like to generate lots of files with creationtime that i decide.
#the following line is generating my files : OK
# this is not changing my datetime...how should i do ? : KO
ERROR: $[System.IO.Directory]::Se tCreationT ime : The term '$[System.IO.Directory]::S etCreation Time' is not recognized as the name of a cmdlet, function, script file,
# then i close the $file
how am i supposed to do this ?
thank you in advance for your tips and help.
toshi
i'd like to generate lots of files with creationtime that i decide.
#the following line is generating my files : OK
$file = New-Object System.IO.FileStream $RootFolder\$fileName, Create, ReadWrite
# i change the size : OK $file.SetLength(1MB)
# i create a datetime : OK $dateTime = [System.DateTime]::Parse("30-11-1973")
# this is not changing my datetime...how should i do ? : KO
[System.IO.Directory]::SetCreationTime($file, $dateTime)
#error ERROR: $[System.IO.Directory]::Se
# then i close the $file
$file.Close()
how am i supposed to do this ?
thank you in advance for your tips and help.
toshi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
toshi