Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the time stamp of an EXE file?

SOLVED
Go to solution
da1nonly1
Advisor

How to change the time stamp of an EXE file?

Hi,

Does anybody know how can I change the time stamp of an EXE file so that when I do the DIR command I see the time that I want the file was created? Is it SET FILE?

Thanks.
5 REPLIES
Ian Miller.
Honored Contributor

Re: How to change the time stamp of an EXE file?

VMS V8.3 SET FILE or the FILE utility found in
older freeware collections.

ftp://ftp.process.com/vms-freeware/fileserv/file.zip

____________________
Purely Personal Opinion
Hein van den Heuvel
Honored Contributor

Re: How to change the time stamp of an EXE file?

A file has several time stamps in VMS.
Modification date, Create date, Backup date,...
Which one would you like to change?

Since you seems to be concerned with EXE files, you may want to use the LINK time as original creation time. This can be foudn IN the image with a program ir ANAL/IMAGE[/INT]

On an 8.3 system you could do something like the following PERL script to set CRE dat to LINK date.

$file = shift or die "Please provide image name as argument";
foreach (`analyze/image $file`) {
system("set file\/attr=creadate=\"$1\" $file\"") if /^\s*link date.time:\s+(.*)$/;
}


On older ALPHA systems the following MACRO program (I just made from bits and pieces I had laying about :-) will set the REVISION date to the LINK date. Other dates are trickier.


hth,
Hein.


$ type SET_RDT_TO_LINK_DATE.mar

.library /sys$library:lib.mlb/
$EIHDDEF ; Alpha Image ident offset
$EIHIDEF ; Alpha Link time offset
.psect data,wrt,noexe
$fabdef
$rabdef
$xabrdtdef
ubf: .blkb 2048
usz = . - ubf
fna: .blkb 80
fnm_desc: .long . - fna
.address fna

fab: $fab fna=fna,-
dnm=<.exe>,-
fac=,- ;File access modes
xab=xabrdt
xabrdt: $xabrdt
rab: $rab fab=fab,-
ubf=ubf,-
usz=usz

fnm_prompt: .ascid "Image file name? "


prompt: .ascid /revision time-MONTH MUST BE IN CAPS-dd-MMM-yyyy hh:mm:ss /

.psect code,nowrt,exe
.entry begin,^M<>
;
; open the file
;
pushal fnm_desc
pushal fnm_prompt
pushal fnm_desc
calls #3, g^LIB$GET_FOREIGN
blbc r0, done

movb fnm_desc, fab+fab$b_fns
$open fab=fab
blbc r0, done

$connect rab=rab
blbc r0, done

$read rab=rab
blbc r0, done

;
; move desired link date into revision date field
;
moval ubf, r0
addl2 EIHD$L_IMGIDOFF(r0), r0
movq EIHI$Q_LINKTIME(r0), xabrdt+xab$l_rdt0
;
; close the file, modify revision date on the deaccess
;
$close fab=fab
done: ret ; Return with final status in r0
.end begin






John Gillings
Honored Contributor

Re: How to change the time stamp of an EXE file?

DFU from the freeware can change timestamps.

Remember there are many timestamps associated with any file.

ACCESSED Specifies the last access date. ATTRIBUTES Specifies the last attribute modification date.
BACKUP Specifies the last backup date.
CREATED Specifies the creation date.
DATA_MODIFIED Specifies the last data modification date.
EFFECTIVE Specifies the effective date the contents are valid (ISO 9660).
EXPIRED Specifies the expiration date.
MODIFIED Specifies the last modification date.
RECORDING Specifies the recording date on the media (ISO 9660).

For an image file, there's also the link date/time stored in the image header

If you COPY an image file, and give it a new name, you will update both creation and modification dates to the current time:

$ dir/date=(cre,mod) zip.exe

Directory DKA100:[EXE]

ZIP.EXE;1 31-MAY-2006 14:17:10.17 29-JUN-2006 12:01:28.06

$ copy zip.exe newzip.exe;/log
%COPY-S-COPIED, DKA100:[EXE]ZIP.EXE;1 copied to DKA100:[EXE]NEWZIP.EXE;1 (215 blocks)

$ dir/date=(cre,mod) newzip.exe

Directory DKA100:[EXE]

NEWZIP.EXE;1 15-JAN-2007 09:06:22.40 15-JAN-2007 09:06:22.44

Before doing this, please think about what you're trying to achieve. Sometimes the dates are used to identify the exact version of the image. If you change it you may make it more difficult for support engineers to diagnose any problems you have with the image.
A crucible of informative mistakes
Wim Van den Wyngaert
Honored Contributor

Re: How to change the time stamp of an EXE file?

The link date can still be found with "anal/ima xxx" where xxx is the name of your exe file. Look for "link date".

Wim
Wim
John Gillings
Honored Contributor
Solution

Re: How to change the time stamp of an EXE file?

>The link date can still be found
>with "anal/ima xxx" where xxx is the name
>of your exe file. Look for "link date".

True, but if you update to V8.2 or higher, you can do even better. See the new /SELECT qualifier to extract just the information you want. ANALYZE also defines symbols containing key attributes. Try:

$ ANALYZE/IMAGE yourimage/OUTPUT=NL:
$ SHOW SYMBOL ANALYZE$*
A crucible of informative mistakes