Posted to vbscript by patthoyts at Fri Aug 25 13:10:26 GMT 2006view raw

  1. <?xml version='1.0'?>
  2. <package>
  3. <job id="CopyDemo">
  4. <runtime>
  5. <description>Demo copying files</description>
  6. <unnamed name="files" many="true" required="true" helpstring="List of files to copy"/>
  7. </runtime>
  8. <script language="VBScript">
  9. <![CDATA[
  10.  
  11. ' This file can be run using 'cscript CopyDemo.wsf filename1 filename2 ...'
  12. ' Or you can drop some files onto the script in explorer and get message boxes.
  13. '
  14. Option Explicit
  15. Dim oFSO, vFile, sMsg
  16. Set oFSo = CreateObject("Scripting.FileSystemObject")
  17. For Each vFile In WScript.Arguments.Unnamed
  18. sMsg = CStr(vFile)
  19. If oFSO.FileExists(sMsg) Then
  20. sMsg = sMsg + " exists"
  21. Else
  22. sMsg = sMsg + " does not exist"
  23. End If
  24. WScript.Echo sMsg
  25. Next
  26.  
  27. ]]>
  28. </script>
  29. </job>
  30. </package>