Insert Exit after FileCopy line if you do not want to get the error message when there is no error. By the way, you need to change "C:\Temp\test..." to "C:\\Temp\\test..." : Cut&Pasted below is a script that will demonstrate my problem. : I'm doing a simple file copy. The source file (testOld.txt in this : case), is set up to be a full read/write protected file. This : simulates my situation and raises the Access Denied runtime error. : The script redirects to the RUN_TIME_ERROR label. It fails without the : dummy number declaration, but continues (as wanted) with the dummy : declaration NOT commented out. I've tried other statements instead : of a Dim statement, some continue to the MessageBox, some error out : to the 24x7 dialog message. : Why? : //== START SCRIPT =============================================== : Dim strSourceFile, string "C:\Temp\testOld.txt" : Dim strTargetFile, string "C:\Temp\testNew.txt" : Dim strMessage, string : OnErrorGoto RUN_TIME_ERROR : FileCopy strSourceFile, strTargetFile : RUN_TIME_ERROR: // Dim i, number : ConcatEx "Got an error!", strMessage : MessageBox strMessage : Exit : //== END SCRIPT ==================================================
|