Interaction With The Operating System >

# System Tools

The global struct called systemTools was added to MAXScript in 3ds Max 4 and was extended in 3ds Max 2008 and 3ds Max 2014.

This group of functions lets you gather various pieces of information about the system 3ds Max is running on.

    systemTools.NumberOfProcessors()

Returns the number of processors (cores) available according to the operating system.

    systemTools.GetScreenWidth()

Returns the screen width including multiple monitors the desktop might be extended to.

    systemTools.GetScreenHeight()

Returns the screen height including multiple monitors the desktop might be extended to.

    systemTools.IsWindows98or2000()

Returns True if the Operating System is Windows98, Windows2000, Windows XP, Windows Vista or Windows 7.

    systemTools.IsWindows9x()

Returns True if the OS is a Win9x flavor.

    systemTools.IsDebugging()

Returns True if running in a Debugger.

    systemTools.getEnvVariable <string>

Returns the contents of specified environment variable. If the specified environment variable does not exist, returns a value of undefined.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions.

EXAMPLE
    systemTools.getEnvVariable "PATH"
    "C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\backburner 2\;"

    <bool>systemTools.setEnvVariable <string> { <string> | undefined }

Sets the contents of specified environment variable.

Returns True if the set occurred, False if not.

If the second argument is the value undefined, the environment variable is deleted.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions.

    <int>systemTools.getmaxstdio()

NEW in 3ds Max 2014: Returns the number of simultaneously open files permitted at the stdio level (i.e. via fopen).

    <int>systemTools.setmaxstdio <int newmax>

NEW in 3ds Max 2014: Sets the maximum number of simultaneously open files at the stdio level (i.e. via fopen).

The valid range for the newmax argument is between 512 and 2048.

Returns the new maximum value if successful.

Retuns -1 otherwise. Fails if attempting to reduce the maximum count and there is an active file handle in one of the slots above newmax.

This could be used for example to allow more Point Cache files to be read in parallel at the same time.

#### See Also

- Interaction With The Operating System

- System Information