BartPE Custom Directory Plugin Builder Script


 

A way to put all your favorite utilities in the BartPE "Nu2Menu" without having to generate hundreds of plugins!


Description:
    This script is designed to be used with the BartPE PE-Builder. PE-Builder allows you to make a bootable CDROM that can run Windows programs. There is no surer way to recover from a virus or from a corrupted hard drive than by using a bootable CDROM.
    You can add your own programs to the BartPE CDROM. In most cases, these programs are copied by the BartPE system from the CDROM to a "ramdisk" before they are actually run. Usually, each program like this requires a separate "plugin" to be built detailing exactly what files must be copied. That's a lot of work...
    However, many utilities are capable of running directly from a CDROM and don't require copying onto a ramdisk! If you have a collection of such utilities, this script will build the necessary "plugin" file for you. That's NOT a lot of work!

Download:
PEMenu.vbs download page

Must-Have Utilities:
Microsoft Virtual CD-ROM Control Panel for Windows XP (works on Windows 2000 too, but not on WinXP-SP2!). With this, you can mount your generated ISO file as a drive so you can run the "Z:\PROGRAMS\NU2MENU\NU2MENU.EXE" program to test your BartPE menus without burning a CD. Mount as many ISO images as you have drive letters.
Daemon Tools Mount up to 4 CD-ROM images as drives. Even images from a protected CD-ROM! Command-line or system tray gui.
Virtual Clone Drive Free software lets you mount up to 8 images as virtual CD-ROM drives.
FileDisk Open-source GNU software mounts and unmounts iso images or hard disk images from the command-line.
IsoBuster can read the ISO files generated by BartPE. It can also save a burned CD as an image file.
Windows-Tools on CD-ROM page by Dirk Loss. An excellent collection of links to CDROM-compatible utilities.
Windows Ultimate Boot CD utilities list by Benjamin Burrows.
Utilities list by Eric Phelps (me!).


Usage:
The name you give the VBS file is the name your plugin will have1.  Make a directory in the BartPE "plugins" folder (In your PEBuilder or BartPE folder under "C:\Program Files"). The name you give this directory doesn't matter, but you might as well name it something meaningful like "Utilities" or "Custom". Whatever name you finally choose, put the "PEMenu.vbs" you just downloaded there.

Rename the "PEMenu.vbs" script to give it the name you'd like your plugin to have. Maybe "Utilities.vbs" or "Custom.vbs". If you have the default Windows behavior of hiding file extensions, either:
  • DON'T add the ".vbs" file extension.
  • DO put quotes around the entire name when you rename it. If in doubt, put quotes around the name. They'll disappear, but it forces Windows to honor your desired file extension.

Anything in your "custom" folder will be in the root of the CDROM2.  Be sure you have a directory somewhere that has files you want included in the BartPE menu system. I'm going to refer to that directory as your "custom" directory. Under that directory, you should have programs which can run directly from the CDROM. Actually, any files directly in your "custom" directory will end up in the root of the CDROM. So your files would probably be better off in a subdirectory under your custom directory! Here I show my "custom" directory is a folder called "Includes". All my Windows GUI programs are under the "Utilities" folder, and all my zip files and installers are under "Archives". You may want to organize yours differently. A special directory is "Bin". That directory is put in the "Path" when BartPE runs, so that's where I place all my command-line utilities and shared DLL files.

This will save you some time later: If there are folders or files in your "custom" directory that you don't want included in the BartPE menu system, hide them. BartPE will still include them on your CD (and they won't be hidden!), but this script will ignore any hidden folders or files when it comes to menu-building. If you look closely, you'll notice my "Archives" and "Bin" folders have been hidden.

If  you want to organize your menu, go ahead and put your files in folders. The script will create a submenu for every non-hidden folder. In my case, you can see I've organized my "Utilities" folder so it has all my custom utilities organized in task-oriented folders. If you take a quick look at the bottom of this page, you'll see the menu that results from something as simple as putting files in folders!

The VBS file will create the HTM, INF, and XML files3.  Go back to the BartPE plugins directory. Double-click the VBS script file. With any luck, a folder browser will come up that will allow you to locate your "custom" directory. Depending on how many files you have under your custom directory, the script may take a few minutes to finish. There should be three new files in the plugin directory: An HTM file, an INF file, and an XML file. These are the three files that define the plugin. Unlike most other plugins, you don't need to copy any additional files into this plugin directory.
  • Next time you do this, try running the script a different way: Drag the "custom" folder and drop it on the script. That way you won't have to browse for your folder.
  • Or, instead of double-clicking, try right-clicking the script and select "Open with Command Prompt".  You'll get a status display instead of wondering what's happening!
  • Go ahead: Try those other ways now. Just be sure the script finishes before you run it again.
4.   Optional. If your "custom" directory had things you didn't want in your menu (like install programs and command-line programs), then this is where you can do some cleanup. You can avoid the cleanup if you follow my advice in step 2 and hide folders or files you don't want menus made for. But let's assume you decided to do it the hard way. That means you've created an XML file with lots of menus you don't want. Which means now you'll have to clean up the XML file by hand! Here's how:

In the BartPE plugins directory, right-click the XML file and select "Open With" and select "Notepad" (browse to it if you must).  If things don't look neat, un-select "Word Wrap" from the "Format" menu.
  • The <MITEM TYPE="POPUP" entries all generate menus in the BartPE "Start Menu". If they point to folders you don't want in the BartPE start menu, you can delete them. If you delete a "popup" menu entry line, you should delete all corresponding section(s) which have the same MENU ID.
  • The <MITEM TYPE="ITEM" lines all create BartPE "Start Menu" entries for actual programs. You can identify what the line is near the end of each line. It will either show the name of the program or a description. If you don't want a certain program to appear in the menu, you can delete the entire line (starting with <MITEM and ending with </MITEM>)
Here I show a sample XML file that I created. If you recall, I had three folders in my "custom" directory. The only thing I wanted in my menu were the programs in the "Utilities" folder. Let's pretend I was foolish and didn't hide the other unwanted folders. So I'll be deleting all the lines that don't have "Utilities" as part of their MENUID (highlighted lines here would be deleted):
Delete lines that have a MENUID you don't want in your menu

See, cleaning up the XML wasn't THAT hard, was it?

If you don't like the description that appears in the menu, you can change it. The script tries really hard to put a decent description in the menu, but you may have better ideas. To change the description, only change the linked text. To help you identify linked text, in the three samples below, the linked text you can change is shown in red:
\stinger.exe">McAfee Stinger (Standalone anti-virus scanner for certain viruses.)</MITEM>
\PDFReader.exe">Foxit PDF Reader</MITEM>
\PUTTY.EXE">PUTTY</MITEM>
My suggestion is to leave the descriptions alone! It isn't worth the trouble. But it's your time...
5.  Start the BartPE PE-Builder program. During the Bart PE Build process, you should select "Add files/folders from (custom) directory".  Select the same directory you previously chose as your "custom" directory. When you get to the plugin list section, you'll find a plugin already enabled with the same name you chose for the script. If you select your plugin, you should be able to hit the "Help" button for a few reminders.


    Once you've completed the process, you only have to do step 5 on subsequent builds. If you later decide to add or delete files in your "custom" directory that will affect your BartPE menu, then you should do steps 3, 4, and 5. Well, hopefully NOT step 4.

    This script isn't perfect, but it saves me a lot of time. It's a lot easier than trying to generate hundreds of separate plugins or try to create an equivalent plugin by hand. I've released the script into the Public Domain, so feel free to improve it or redistribute it.
The Utilities menu shown here was created by this script

Lost? Look at the site map.

Bad links? Questions? Send me mail.

Google
Yahoo
Ask Jeeves