Jump to content

Comparing Modification Date from 2 Files


 Share

Recommended Posts

Hi,

I'm trying to compare 2 modified dates, i wanna know just when they are equal or not.

Always says that it's "Equal", i have changed all dates possible and still did not change the result.

 

#include <Date.au3>
$sFile1=@ScriptDir&"C:\folder\file1.exe"
$sFile2=@ProgramFilesDir&"C:\folder\file2.exe"

$FileTime1 = FileGetTime("CC:\folder\file1.exe", 0, 1)
$FileTime2 = FileGetTime("C:\folder\file2.exe", 0, 1)

If $FileTime1=$FileTime2 Then
    MsgBox(0, "Title", "EQUAL", 10)
Else
    MsgBox(0, "Title", "DIFFERENT", 10)
EndIf

 

Screenshot_7.png

Link to comment
Share on other sites

The first filegettime is pointed at a path that doesnt exist, and im going to guess the second file does not exist in that location either, and two wrongs make a true.

Also sFile1 and sFile2 are wrong, go read how to use the macros.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...