filebox

display an open or save dialog box 

Command


SYNOPSIS

filebox [-acDmnops] [-ddir] [-eext] [-fname/filter_pairs] [-ifile] [-I#] [-ttitle]

filebox -V [-DEMNU] [-ddir] [-ttitle]


DESCRIPTION

The filebox command displays a dialog box on screen, offering users the choice of opening or saving files.

Upon successful selection of a file, the full path to the selected file is printed to standard output, and a value of 0 is returned. Upon abort by the user, nothing is printed to standard output and a value of 1 is returned.

If the -m option (multiple file selection allowed) is selected, multiple file names are printed to standard output, one per line, upon successful selection.

Options

-a 

requires file to already exist. If file does not exist, the user is warned and prompted for another file name.

-c 

if the specified file does not exist, asks you if the file should be created. If you respond yes, the program exits successfully. If you respond no, filebox prompts for another file name. Note that no file is actually created by this utility; this option simply prevents users from selecting a file without confirming that one should be created.

-ddir 

specifies the initial directory. When used with the -V option, dir is assumed to be the name of a special folder (see Special Folders for a list).

-D 

displays a directory selection dialog instead of the default file selection dialog. With the -V option, this dialog can also be used to select computer names.

-E 

includes an edit box on the displayed dialog. This allows users to directly input the item they are searching for.

-eext 

specifies the default extension if none is specified by the user. ext may be any number characters in length, but only the first three characters are used as the default extension. The default extension ext is only appended to files if the user fails to specify an extension.

Note:

Do not include a . (dot) as a character in ext.

-fname/filter_pairs 

specifies name/filter pairs. These are listed in the List files of type: listbox. Each name and filter is listed, separated by forward slashes. Multiple wildcard patterns can be specified by separating the names with semicolons. For example:

filebox -f 'All files/*.*/Documents/*.txt;*.doc'
-ifile 

specifies the initial file name to be placed in the user file name input area.

-I# 

specifies the initial index of the filters to be used (starting at 1). In the above example for the -f option, -I 2 would cause Documents to be used as the default filter.

-M 

does not display a New Folder button on the dialog.

-m 

allows selection of multiple files.

-N 

displays a newer enhanced version of the dialog. This enhanced version includes the ability to drag and drop items within the dialog, reordering, shortcut menus, new folders, and other features.

-n 

does not display the Network... button.

-o 

when specified with -s option and the selected file already exists, this option prompts you to see if the file should be overwritten. if you respond no filebox prompts for another file name. If you select yes, filebox returns successfully.

-p 

specifies that the leading path must exist. If you enter a full path and file name, and the path does not exist, filebox gives an error message and prompts for another file name.

-s 

presents a Save dialog box instead of an Open dialog box.

-ttitle 

specifies the text to be used on the title bar of the dialog box.

-U 

allows the dialog to accept URLs if the folder accepts it. When this option is specified, the -N and -E options are also implied. That is, the newer enhanced dialog box is displayed and includes an edit box.

-V 

allows you to browse to a special folder or another computer. See Special Folders for an explanation of special and virtual folders.

Special Folders

Windows systems support two types of special folders: file system folders and virtual folders. File system folders are actual folders that exist on the file system (for example, Program Files) that Windows assigns a special name to, while virtual folders do not actually exist as real folders (for example Control Panel).

The following is a list of special file system folders along with the operating systems on which they can be found. If no operating system is explicitly mentioned, the folder can be found on all currently supported operating systems.

ALTSTARTUP 

Identifies the directory that contains your nonlocalized Startup program group. This folder is only available on Windows NT systems.

APPDATA 

Identifies the common storage directory for your application specific data. For example, C:\Documents and Settings\username\Application Data.

CDBURN_AREA 

Identifies the directory being used as a staging area for files to be burned to CD. For example, C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\CD Burning. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems

COMMON_ADMINTOOLS 

Identifies the directory that contains the administrative tools common to all users. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

COMMON_ALTSTARTUP 

Identifies the directory containing the nonlocalized Startup program group used for all users. This folder is only available on Windows NT systems.

COMMON_APPDATA 

Identifies the directory that contains application data common to all users. For example, C:\Documents and Settings\All Users\Application Data This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

COMMON_DESKTOPDIRECTORY 

Identifies the directory that contains the files and folders that appear on all users' desktops. For example, C:\Documents and Settings\All Users\Desktop.

COMMON_DOCUMENTS 

Identifies the directory that contains the documents common to all users. For example, C:\Documents and Settings\All Users\Documents.

COMMON_FAVORITES 

Identifies the directory that contains the favorite items common to all users. For example, C:\Documents and Settings\All Users\Favorites.

COMMON_MUSIC 

Identifies the directory that contains music files common to all users. For example, C:\Documents and Settings\All Users\Documents\My Music. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

COMMON_PICTURES 

Identifies the directory that contains image files common to all users. For example, C:\Documents and Settings\All Users\Documents\My Pictures. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

COMMON_PROGRAMS 

Identifies the directory that contains the Startup menu program groups common to all users. For example, C:\Documents and Settings\All Users\Start Menu\Programs.

COMMON_STARTMENU 

Identifies the directory containing the programs and folders common to all users' Start menus. For example, C:\Dcouments and Settings\All Users\Start Menu.

COMMON_STARTUP 

Identifies the directory that contains the programs common to all users' Startup folders. For example, C:\Documents and Settings\Start Menu\Programs\Startup.

COMMON_TEMPLATES 

Identifies the directory that contains the templates that all users can use. For example, C:\Documents and Settings\All Users\Templates.

COMMON_VIDEO 

Identifies the directory that contains video files common to all users. For example, C:\Documents and Settings\All Users\Documents\My Video. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

COOKIES 

Identifies the directory that contains all cookies you have obtained from the Internet. For example, C:\Documents and Settings\username\Cookies.

DESKTOPDIRECTORY 

Identifies the directory used to physically store file objects on your desktop. Do not confuse this with the desktop folder itself. For example, C:\Documents and Settings\username\Desktop.

FAVORITES 

Identifies the directory that contains your favorite items. For example, C:\Documents and Settings\username\Favorites.

HISTORY 

Identifies the directory that contains Internet history items.

INTERNET_CACHE 

Identifies the directory that contains temporary Internet files. For example, C:\Documents and Settings\username\Temporary Internet Files.

LOCAL_APPDATA 

Identifies the directory that contains data for all local (non-roaming) applications. For example, C:\Documents and Settings\username\Local Settings\Application Data. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

MYMUSIC 

Identifies the My Music folder. For example, C:\Settings and Documents\username\My Documents\My Music. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

MYPICTURES 

Identifies the My Pictures folder. For example, C:\Settings and Documents\username\My Documents\My Pictures. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

MYVIDEO 

Identifies the My Video folder. For example, C:\Settings and Documents\username\My Documents\My Video. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

NETHOOD 

Identifies the directory that contains objects appearing in your network neighborhood. For example, C:\Documents and Settings\username\NetHood.

PERSONAL 

Identifies the directory that contains all your documents. For example, C:\Documents and Settings\username\My Documents.

PRINTHOOD 

Identifies the directory that contains all your printer links. For example, C:\Documents and Settings\username\PrintHood.

PROFILE 

Identifies the directory that contains your profile. For example, C:\Documents and Settings\username. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

PROFILES 

Identifies the directory that contains your profile folders. For example, C:\Documents and Settings. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

PROGRAM_FILES 

Identifies the Program Files folder. For example, C:\Program Files. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

PROGRAM_FILES_COMMON 

Identifies the Program Files folder that is common to all users. For example, C:\Program Files\Common. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

PROGRAMS 

Identifies the directory that contains your program groups. C:\Documents and Settings\username\Start Menu\Programs.

RECENT 

Identifies the directory that contains your most recently used documents. For example, C:\Documents and Settings\username\Recent.

SENDTO 

Identifies the directory that contains your Send To menu items. For example, C:\Documents and Settings\username\SendTo.

STARTMENU 

Identifies the directory that contains your Start menu items. For example, C:\Documents and Settings\username\Start Menu.

STARTUP 

Identifies the directory that contains your Startup program group. For example, C:\Documents and Settings\username\Start Menu\Programs\Startup.

SYSTEM 

Identifies the Windows System folder. For example, C:\Windows\System32. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

TEMPLATES 

Identifies the directory that contains all document templates.

WINDOWS 

Identifies the Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. For example, C:\Windows. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

The following is a list of virtual folders found on Windows systems.

ADMINTOOLS 

Is a virtual folder for your administrative tools. This folder is only available on 8.1/2012R2/2016/2019/2022 systems.

BITBUCKET 

Is a virtual folder containing objects in your Recycle Bin.

CONTROLS 

Is a virtual folder containing icons for Control Panel applications.

DESKTOP 

Is the Windows Desktop virtual folder that is the root of the name space.

DRIVES 

Is the My Computer virtual folder containing everything on the local computer: storage devices, printers, and Control Panel. This folder may also contain mapped network drives.

FONTS 

Is a virtual folder containing fonts.

INTERNET 

Is a virtual folder that represents the Internet.

MYDOCUMENTS 

Is a virtual folder that represents the My Documents desktop icon. This folder is only available on Windows 8.1/2012R2/10/2016/2019/11/2022 systems.

NETWORK 

Is the Network Neighborhood virtual folder representing the top level of the network hierarchy.

PRINTERS 

Is a virtual folder containing installed printers.


DIAGNOSTICS

Possible exit status values are:

0 

Successful.

1 

Abort.

2 

Failure due to an invalid command line argument.


PORTABILITY

Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


AVAILABILITY

PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
msgbox

Using the MKS KornShell


PTC MKS Toolkit 10.4 Documentation Build 39.