Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduced in



Description:Takes a screenshot of current scene.

If fileName is not present (i.e. empty string "") or ends with "\" or "/", then folder %USERPROFILE%\My Documents\VBS2\Screenshots (plus any specified subfolders) will be created if non-existent, and a file name is generated from the date information (e.g. 2008_4_18_18_0_15_250.tga).

If fileName starts with "\" or "/", the file will be written to %USERPROFILE%\My Documents\VBS2\Screenshots. (Screenshots folder, or any referred subfolders, must exist already!)

If fileName is present and doesn't end with "\" or "/", then it is considered an absolute file path, and will be written to that location (destination folder must already!).

The file extension is automatically added to the fileName, according to the specified fileType.

If size definitions are used, be aware that the screenshot is only resized. It is not possible to increase precision beyond the current screen resolution.

If VBS was started with the -forceSimul parameter screenshots can be taken even if the window has been minimized.


Syntax:vbs_screenshot [fileName, fileType, width, height]
  • fileName: String - Name of file to be saved. Can include path, or be left empty for automatic name.
    If illegal characterscharacters (see are used in the filename, then no file is created.
  • fileType: String - Can be BMP, JPG, TGA, PNG, DDS, PPM, DIB, HDR or PFM. If not present or unknown, then JPG will be used.
  • width: Number - Width of saved screenshot. (optional, default: 0 == current resolution) V1.30+.
  • height: Number - Height of saved screenshot. (optional, default: 0 == current resolution) V1.30+.
Return Value:Nothing


vbs_screenshot ["","jpg",256,256]
Saves screenshot with default name to %USERPROFILE%\My Documents\VBS2\Screenshots

vbs_screenshot ["file","jpg",256,256]
Saves "file.jpg" to the VBS2 installation folder

vbs_screenshot ["\file","jpg",256,256]
Saves "file.jpg" to %USERPROFILE%\My Documents\VBS2\Screenshots

vbs_screenshot ["\folderName\file","jpg",256,256]
Saves "file.jpg" to %USERPROFILE%\My Documents\VBS2\Screenshots\folderName

vbs_screenshot ["\folderName\","jpg",256,256]
Saves screenshot with default name to %USERPROFILE%\My Documents\VBS2\Screenshots\folderName

Additional Information

See also: captureStart