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

FileMenu

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

Running WBT from Explorer File Menu

Keywords: filemenu   

Question:

I have created a Explorer context menu for extension LST using filemenu. The only menu choice is to call a WBT (passing the file name as param1). The first line in the script which is called is AddExtender("wwctl34I.dll")

I can run the wbt in various ways other than from filemenu, but when it is called from filemenu I get an error message that the extender dll can not be found. I don't especially want to hard code the entire path into the addextender statement. Is there another way to make it find-able?

When I use:

	extend=strcat(DirHome(),"wwctl34I.dll")
	AddExtender(extend)
and run it from filemenu, dirhome returns c:\windows instead of the winbatch directory.

Answer:

ErrorMode(@OFF)
wbdir=RegQueryValue(@REGMACHINE,"SOFTWARE\Wilson
WindowWare\WinBatch\CurrentVersion")

if wbdir==0 
wbdir=RegQueryValue(@REGMACHINE,"SOFTWARE\Wilson WindowWare\WinBatch
Compiler\CurrentVersion")

endif

ErrorMode(@CANCEL)

if wbdir==0
Display(5,"Error","Registry entries missing. Re-install WinBatch")
exit
endif

homedir=strcat(wbdir,"system\")

extend=strcat(homedir,"wwctl34I.dll")
AddExtender(extend)

Question (continued thread):

I have successfully created a filemenu for a specific extension which calls a WBT file and passes the name of the selected file. The WBT fiddles with the file, loads it into an app and prints it (then closes the app). I want to be able to select a group of files, choose my menu item and process the entire group. But when I do any kind of multiple select the WBT runs only once.

Is there a way to make my filemenu run for all files selected?

Answer (thread continued):

Ummm... Something like this in your filemenu script:
myfiles=FileItemize("")
mycount=ItemCount(myfiles,@tab)
for xx=1 to mycount
thisfile=ItemExtract(xx,myfiles,@tab)
Runwait("yourfile.wbt",thisfile)
next

Article ID:   W13022
Filename:   Running WBT from FileMenu.txt
File Created: 2001:03:01:14:45:00
Last Updated: 2001:03:01:14:45:00