A. The script below, which you can download here will display the domain mode of a specified domain:

If Wscript.Arguments.Count 
Run the script by using the following command:
C:\temp>cscript showdomainmode.vbs savilltech.com

To check the forest mode, run the following script with no parameters to display the forest mode of the forest of the client that the script runs on. You can download the script here

set objRootDSE = GetObject("LDAP://RootDSE")
set objDomain = GetObject("LDAP://cn=partitions," & objRootDSE.Get("configurationNamingContext") )
if objDomain.Get("msDS-Behavior-Version") = 2 then
Wscript.Echo "Windows Server 2003"
ElseIf objDomain.Get("msDS-Behavior-Version") = 1 then
script.Echo "Windows 2003 Interim"
Wscript.Echo "Windows 2000"
End If