Wain2021
Wain2021

Reputation: 349

Electron get exe's creation date

I am looking for a way to check an external .exe creation date from within my electron application.

Any pointers would be greatly appreciated as I can't find any code via google.

Upvotes: 0

Views: 65

Answers (1)

akshayks
akshayks

Reputation: 249

You can use node's fs module to achieve what you want. Just use the following:

const fs = require('fs');
fs.stat('path-to-exe', (error, stats) => {
  if (error) {
    console.log(error);
  }
  else {
    let creationTime = stats.birthtime;
    console.log('Creation time: ', creationTime);
  }
});

Upvotes: 1

Related Questions