Jump to content

CopyFile then FileGetVersion... fails?


Recommended Posts

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]

Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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
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...