Paraglider WinBuilder Pages

FindFile WinBuilder Script

This is a winbuilder script to install my FindFile utility which will search the optical CD / DVD and  / or USB drives for a specified file on media with a specified label.

The program is called as follows:

FindFile <Media Type> <Media Label> <Relative FileName>


<Media Type> - This defines the type of drives to scan. It can take the following values:

  • X - both optical and USB drives
  • CD - optical CD / DVD drives only
  • USB - UDB drives

<Media Label> - Label of media being searched for.

<Relative FileName> - Relative name of file that will be searched for. The path is the path relative to the media root.

Assuming the file is found the full path to the file will be output to stdout.

The exit code for the process will be the found drive number.

The found drive letter will also be written to a system environment variable named CDDRIVE. A settings change broadcast will be made so the shell can reload its copy of the environment variables. Not all shells support processing this broadcast; explorer does.

Example Usage:

FindFile X Win7PE sources\boot.wim

This will search all optical and USB drives with a label of Win7PE for a file named sources\boot.wim.