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.wbtand 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\scriptsGenerally, 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
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.
- nothing happens or
- I get an error from winbatch --
"script not found".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.
- 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- Now put a shortcut to MYSTUFF.BAT in your SendTo directory. Edit the shortcut to select "CLose window on exit".
- 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)- 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: W13166Filename: Launch a WBT File using Explorer SendTo.txt