drag n drop via WSH 
Author Message
 drag n drop via WSH

I just read the MIND article about drag n drop via WSH, and it seems to me
that this really should just be built in to WSH. By default, when you drop a
file or files on a script icon, or shortcut, that script should be called,
and the file list be present in a collection. Perhaps in the next version of
WSH this will be the case? Or, has any intrepid third party already written
this? I have a number of uses for this capability, but I don't know C++, so
I cannot roll my own.

Anyone have any thoughts?

Regards,
Gordon Price



Thu, 17 May 2001 03:00:00 GMT  
 drag n drop via WSH

Quote:

> I just read the MIND article about drag n drop via WSH, and it seems to me
> that this really should just be built in to WSH. By default, when you drop a
> file or files on a script icon, or shortcut, that script should be called,
> and the file list be present in a collection. Perhaps in the next version of
> WSH this will be the case? Or, has any intrepid third party already written
> this? I have a number of uses for this capability, but I don't know C++, so
> I cannot roll my own.

> Anyone have any thoughts?

I agree, wholeheartedly.  I believe it is a truly absurd oversight on
MS's part.

The only work around I have been able to come up with is to wrap the
script in a batchfile and start the batch file via a shortcut (that
minimizes the command prompt session on the taskbar), something like
this ...


  shift
  wscript "C:\Scripts\test.vbs" %0 %1 %2 %3 %4 %5 %6 %7 %8 %9

It requires the script's location to be hard coded into the batch
wrapper.  A possible extension might be ...


  set DaD=%1
 :Loop
  if not [%3]==[] set DaD=%Dad% %2
  if not [%3]==[] for %%v in (shift goto:Loop) do %%v
  if exist %2 wscript %2 %DaD%

This would allow the the script's name to be appended as an argument to
the batch procedure on the shortcut's 'Cmd line'.  The procedure
collects if from the tail end of the drag and drop list of command line
arguments.  Then one batch file could serve all script shortcuts.  Note
that the command line is limited to no more than 256 characters in this
context, so the number of D&D arguments is severly limited.  Clearly a
full directory of file names can not be passed in this manner, though
the directory name could be substituted as long as the script were
constructed to handle the distinction.  Still, it sure seems silly to
need an anachronistic batch procedure to run a Win script.

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Fri, 18 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Change extension via drag/drop or SendTo target

2. Merging Word files via Drag and Drop

3. Status of drag and drop in WSH 2.0 Beta

4. WSH Drag & Drop Handler

5. WSH/Java drag & drop file hexdumper

6. DRAG AND DROP

7. preventing print scrn and drag and drop of image in IE 5.5

8. ActiveX TreeView control not allowing drag drop

9. ActiveX TreeView Drag 'n Drop

10. ps2pdf shortcut for drag-n-drop (windows)

11. Drag-And-Drop

12. have you tried drag-and drop

 

 
Powered by phpBB® Forum Software