WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Launch a WBT File using Explorer SendTo

Keywords: 	  Send a WBT File Explorer SendTo

Question:

I am using winbatch uncompiled. I would like to add a shortcut to a winbatch script to the windows "sendto" folder so that I can rightclick a file or directory in explorer and send its name to the script.

I create a shortcut in the folder and have tried the following lines

  H:\winbatch\system\winbatch.exe                   H:\winbatch\scripts\scriptname.wbt
(the above 2 lines concatenated)
  H:\winbatch\scripts\scriptname.wbt
and others. I have tried using various combinations of quotes. I have also varied the "Start In" directory on the shortcut to either nothing or H:\winbatch\scripts

Generally, if I click on the icon in the sendto folder, the script runs (but with an error since there is no parameter passed). This is clear evidence that the system associates ".wbt" scripts with winbatch and that the shortcut when clicked runs the whole command line given.

However, if I use the rightclick sendto menu, either

  1. nothing happens or

  2. I get an error from winbatch --
           "script not found".  
    
My guess is that the system is just passing the file/folder name to winbatch and omitting the script named on the shortcut command line.

Is there a way to make a shortcut in the sendto folder work?

Answer:

It's tricky. It's *really* wants to be compiled.

However I have a workaround for you. Not great but it works.

  1. Put a file MYSTYUFF.BAT someplace. The contents should be
    REM START
    
    "c:\program files\WinBatch\System\WinBatch.exe" "C:\stuff\mystuff.wbt" "%1"
    
    REM END
    
  2. Now put a shortcut to MYSTUFF.BAT in your SendTo directory. Edit the shortcut to select "CLose window on exit".

  3. Test it (I used the following script)
    pc=param0
    line=""
    
    for xx=1 to pc
       line=strcat(line,param%xx%,@crlf) 
    next
    
    Message(param0,line)
    
    
  4. Select "run minimized" in the program tab of the shortcut pif dialog.

Resolution:

Thanks. It works like a charm except for a longer startup time.
Article ID:   W13166
Filename:   Launch a WBT File using Explorer SendTo.txt
File Created: 2001:01:15:10:52:04
Last Updated: 2001:01:15:10:52:04