You can drag files onto a WSH script. The file names are translated into arguments on the command line. These file names can be displayed in a list, which you can use to manipulate files with any scripting object.

Procedures

To display a script's argument list

  1. Create a file and give it a name with a script extension (for example, DragDrop.vbs).

  2. Add code to the script file, for example:

     CopyCode imageCopy Code
    Set objArgs = WScript.Arguments
    For I = 0 to objArgs.Count - 1
       WScript.Echo objArgs(I)
    Next
  3. Save the file to your hard disk.

  4. Drag and drop any file or files onto your saved file. In the example, the file names are echoed back to the screen.

The number of files you can drag onto a script is limited by your system's maximum command-line length. If the total number of characters in all file names being dragged exceeds this limit, the drag and drop operation fails.

In Vbsedit, you only need to press F1 to get Help for the keyword under the cursor!


Download Now!



Download   Home  

Copyright © 2001-2024 adersοft