@echo off :: This script is the first one run to start gathering host info from domain. :: Normally, it will use the current domain, but can connect to a trusting domain, :: like a sub-domain. :: This script can accept a filename as input which contains a line: :: A working FQDN with domain controller for the specified sub-domain. Example: :: domaincontroller1.subdomain.mydomain.com IF "%1"=="" GOTO :UseCurrentDomain :: Get TLD of FQDN from value stored in filename entered, for display in CMD window title FOR /F "tokens=2 delims=." %%a IN ('TYPE %1') DO SET LDAPSTRING=%%a ECHO LDAPSTRINGFile=%1 START "CreateADList" /MIN CreateADList.bat %1 ECHO "CreateADList.bat" %LDAPSTRING% started in external window! GOTO :EOF :UseCurrentDomain START "CreateADList" /MIN CreateADList.bat ECHO "CreateADList.bat" started in external window!