Jump to content

Get File Version & Pipe To A File


BKJ
 Share

Recommended Posts

I am looking for a simple script that will get the file version of a particular file and then write the output to a text file on a network share. Can anyone help me with this easy script? I will need to run this on many workstations so the file must be either appended to or a specific file for each machine, ie %computername%.txt, will need to be created. If using a single appended file I will need to have the machine name included in the text file along with the file version. I thank you in advanced.

Link to comment
Share on other sites

I am looking for a simple script that will get the file version of a particular file and then write the output to a text file on a network share. Can anyone help me with this easy script? I will need to run this on many workstations so the file must be either appended to or a specific file for each machine, ie %computername%.txt, will need to be created. If using a single appended file I will need to have the machine name included in the text file along with the file version. I thank you in advanced.

You can get the file version with FileGetVersion() and then append the status to the file you want using _FileWriteLog() and naming the file via the macro @ComputerName. Have you written any AutoIT code yet?

:think:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You can get the file version with FileGetVersion() and then append the status to the file you want using _FileWriteLog() and naming the file via the macro @ComputerName. Have you written any AutoIT code yet?

:think:

No I have not. What I do have is only this:

$ver = FileGetVersion("C:\Program Files\MOZILLA FIREFOX\firefox.exe")

MsgBox(0, "FireFox Version", $ver)

Which I got from the help file. But like I said I need it to go to a file on a network share.

Edited by BKJ
Link to comment
Share on other sites

No I have not. What I do have is only this:

$ver = FileGetVersion("C:\Program Files\MOZILLA FIREFOX\firefox.exe")

MsgBox(0, "FireFox Version", $ver)

Which I got from the help file.

Cool, now combine that with writing it to the log file:

#include<file.au3>
$ver = FileGetVersion("C:\Program Files\MOZILLA FIREFOX\firefox.exe")
_FileWriteLog('C:\' & @ComputerName & '_FileVer.log', $ver)

In order to use the User Defined Function (UDF) _FileWriteLog(), you have to include the file.au3 file. You get the file version, then the next line writes it to a log file with a date/time stamp. You can run it more than once and it will just keep adding to the file. If you don't want the date/time stamp, change it to FileWriteLine. The log file will be in C:\, but you can edit that as required too...

:think:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...