09 January 2024, 14:28 | #1 |
Registered User
Join Date: May 2020
Location: Figueira da Foz
Posts: 451
|
Getting Version values into text
I would like to use List so I could automatically comment the version of each command. The thing is I cannot find a version command that allows me to pipe its result to a text file.
If I do: version c:dir >t:dir.ver It gives nothing but an empty file. |
09 January 2024, 15:09 | #2 |
Registered User
Join Date: Apr 2022
Location: Australia
Age: 52
Posts: 932
|
try version c:dir >t:dir.ver.txt
|
09 January 2024, 15:35 | #3 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,309
|
just did it using a small script to help automate it.
Code:
.KEY FILENAME/A IF EXISTS <FILENAME> Filenote <FILENAME> "`Version <FILENAME>`" QUIET ENDIF then typed Code:
LIST C:#? LFORMAT "FILEVERSION %P%N" >RAM:DOIT Code:
FILEVERSION C:xUp FILEVERSION C:xType FILEVERSION C:xScan FILEVERSION C:xQuery FILEVERSION C:xPack FILEVERSION C:xPK FILEVERSION C:xLoadSeg FILEVERSION C:xDir FILEVERSION C:xBench FILEVERSION C:wpa_passphrase FILEVERSION C:winlaunch FILEVERSION C:whdload-updated FILEVERSION C:wget FILEVERSION C:uuidgen FILEVERSION C:untgz FILEVERSION C:translate then just executed the file in RAM:, any/all files in C: get a filenote of the version string "IF" one exists. Not sure how to fudge that into a 1 line or 1 file solution. also had to add "FAILAT 100" at the top of the DOIT file as it errors out when a version string does nto exist. in fact the above kinda needs a better way to deal with no string found as it currently lumps the version error text into the filenote using the above when no version is found, someone smarter can probably fix that issue in a clever way. Last edited by DisasterIncarna; 09 January 2024 at 15:42. |
09 January 2024, 16:23 | #4 |
Registered User
Join Date: May 2020
Location: Figueira da Foz
Posts: 451
|
:O easy as pie! Thanks a lot! That worked beautifully
|
09 January 2024, 20:37 | #5 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,424
|
Quote:
Code:
LIST C:#? LFORMAT "FILEVERSION %P%N" | EXECUTE |
|
09 January 2024, 23:14 | #6 | |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,309
|
Quote:
1 problem with the little solution i used is that if no version string is present then the error output is added as a filenote (Could not find version Information for C:FileName, Version failed, returncode 20) rather than nothing, any idea if there is a better way to suppress that unwanted output from the Version command? At a guess i think something would need to be added to the script when an error/failat 20 occurs so maybe an empty/blank filenote is added to overwrite the error string that gets added currently, maybe thats overkill and a simpler solution exists. |
|
09 January 2024, 23:45 | #7 |
Coder/webmaster/gamer
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,706
|
Version command output redirection works fine here, maybe you are using some old buggy version.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SetPeriod does not seem to like values I am inputting | Amiga1992 | Coders. Blitz Basic | 8 | 10 March 2021 00:28 |
Default display values | chip | support.WinUAE | 6 | 06 January 2018 14:00 |
Finegrain_cpu_speed values | hexaae | support.WinUAE | 2 | 14 August 2016 14:36 |
Discretizing / Normalizing Values in C/C++ | Zetr0 | Coders. General | 4 | 04 December 2006 09:29 |
|
|