expirate date to exe
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 2
- Last visit: Fri Dec 22, 2023 6:35 pm
expirate date to exe
Hi there, how to add expirate date to *.exe with creation date +30 days
Last edited by tupac4u2023 on Sat Jan 14, 2023 3:31 pm, edited 2 times in total.
-
- Posts: 2
- Last visit: Fri Dec 22, 2023 6:35 pm
Re: expire date to exe
Thanks for reply, something like this, but using the creation date of the *.exe or script and after 30 days it cannot be executed.
$DTCurrent = get-date
$DTExpiry = [datetime]::ParseExact('30/11/2019','dd/MM/yyyy',$null)
if ($DTCurrent -gt $DTExpiry)
{
Write-Host "Thats all folks, $($Filename.Name) is expired"
break
}
else
{
Write-Host "Keep Running: $($Filename.Name)"
}