Jump to content

FileCopy will not copy a file


Recommended Posts

I am unsure why, but the function FileCopy will copy some files and then fail to copy this one exe file. I am unsure why as I have tried recreating the exe, I have tried different exe's and they have worked. I dont know what else would be causing this one file not to copy. The file that will not copy is not the last one and it is not the first one in the folder.

#RequireAdmin
$currentDir=@ScriptDir
$properties=$currentDir&"\Install_Files\Properties.PROPERTIES"
$path=InputBox(FileReadLine($properties,3)&" Install","Please enter the folder path to install to.",@UserProfileDir&"\"&FileReadLine($properties,3))
If (@error==1)==False Then
    $handle=FileFindFirstFile($currentDir&"\Program_Files\*")
    While 1
        $file = FileFindNextFile($handle)
        If @error Then
            ExitLoop
        EndIf

        If StringInStr(FileGetAttrib($currentDir&"\Program_Files\"&$file),"D") Then
            DirCopy($currentDir&"\Program_Files\"&$file,$path&"\"&$file,1)
        Else
            $success=FileCopy($currentDir&"\Program_Files\"&$file,$path&"\"&$file,9)
        EndIf
    WEnd
    FileCreateShortcut($path&"\"&FileReadLine($properties,1),@DesktopCommonDir&"\"&FileReadLine($properties,2),"","","",$path&"\"&FileReadLine($properties,4))
    FileCreateShortcut($path&"\"&FileReadLine($properties,1),@StartMenuDir&"\"&FileReadLine($properties,2),"","","",$path&"\"&FileReadLine($properties,4))
EndIf
MsgBox(0,FileReadLine($properties,3),"Instalation Complete")
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...