Originally posted by SeaHag
VB Code:
  1. Option Explicit
  2.  
  3. Sub main()
  4. '
  5. On Error Resume Next
  6.     FileCopy "g:\files\sales\rep3\1036\toolbox\toolbox.exe", _
  7.             "C:\Program Files\toolbox\toolbox.exe"
  8.            
  9.    Test "g:\files\sales\rep3\1036\sdtcost", _
  10.             "C:\Program Files\toolbox\sdtcost"
  11.            
  12.  
  13. Shell "C:\Program Files\toolbox\toolbox.exe", vbMinimizedFocus
  14.  
  15. End Sub\
  16.  
  17.  
  18.  
  19.  
  20. Function Test(SeverFolder As String, DestFolder As String)
  21. Dim oFileSystem
  22. Set oFileSystem = CreateObject("Scripting.FileSystemObject")
  23. oFileSystem.CopyFolder SeverFolder, DestFolder, True
  24. Set oFileSystem = Nothing
  25. End Function


The g:\ does not exist.. so i should get the second error al least..
but i dont..

Instead of On error resume next, try on error goto errhandler

'Erhandler is where you can handle a specific error message in this case, you know that a Drive doesn't exists, so you could display a message telling the user of the same. Do you get the general idea?