WindowsDirectory Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Use the OSInfo.WindowwsDirectory property to get the path to the folder in which the operating system is installed.

Declaration

OSInfoObj.WindowsDirectory

Read-Only Property String
OSInfoObj An expression, variable or parameter that specifies a reference to an OSInfo object

Applies To

The property is applied to the following object:

Property Value

The string that represents the path to the operating system directory.

Example

The following example posts the path to the Windows folder to the test log.

JavaScript, JScript

function Test()
{
  var sTempFolder = Sys.OSInfo.WindowsDirectory;
  Log.Message(sTempFolder);
}

Python

def Test():
  sTempFolder = Sys.OSInfo.WindowsDirectory
  Log.Message(sTempFolder)

VBScript

Sub Test
  Dim sTempFolder
  sTempFolder = Sys.OSInfo.WindowsDirectory
  Log.Message sTempFolder
End Sub

DelphiScript

procedure Test;
var sTempFolder;
begin
  sTempFolder := Sys.OSInfo.WindowsDirectory;
  Log.Message(sTempFolder);
end;

C++Script, C#Script

function Test()
{
  var sTempFolder = Sys["OSInfo"]["WindowsDirectory"];
  Log["Message"](sTempFolder);
}

See Also

SystemDirectory Property
TempDirectory Property

Highlight search results