aaloway Posted May 22, 2014 Posted May 22, 2014 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")
aaloway Posted May 23, 2014 Author Posted May 23, 2014 It is another program that I created in c#. The other exe that did copy is also one I made in c#
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now