Jump to content
Sign in to follow this  
DarkBoost

CopyFile then FileGetVersion... fails?

Recommended Posts

DarkBoost

As per the attachment it does not appear to obtain the FileGetVersion after a FileCopy even running a Loop & Sleep statement. Any ideas?

Edited by DarkBoost

Share this post


Link to post
Share on other sites
Skruge

As per the attachment it does not appear to obtain the FileGetVersion after a FileCopy even running a Loop & Sleep statement. Any ideas?

Looks like you're reading the version before the copy, so the file doesn't exist.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
nfaustin

Place the FileGetVersion inside the If statement before it exit the loop.


[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]

Share this post


Link to post
Share on other sites
DarkBoost

I have managed to get past this, however wondering if this may be a little long-winded?

$file = "example.exe"
$path = @ScriptDir&"\"
$pathtest = @ScriptDir&"\test\"

version();check if file exists -> test\example.exe
If FileCopy($path&$file, $pathtest, 8) = 0 Then Exit;copy file to folder -> test
While 1
    If FileExists($pathtest&$file) Then ExitLoop;loop script until file exists
WEnd
version();check if file exists -> test\example.exe

Func version()
    $version = FileGetVersion($pathtest&$file)
    If FileExists($pathtest&$file) Then MsgBox(0, "", $version);show version of copied file
EndFunc
Edited by DarkBoost

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.