Answering myself:
I used a batch script to unlock my machine automatically and rdp into the desired test environment. Scheduled to run the batch at the time of running the tests. Scheduled the testcomplete scripts batch on each test environment in sync with the rdp connection time.
Let me know if there is a better approach.
My batch file: (Runs fine of Win XP and Win Server 2003)
@ECHO off
REM Auto Login into my machine at the time of the nightly run schedule if the system is locked
REM For the following line to work logon.exe utility should be present at the location
"D:\Automation utilities\logon.exe" -u username -p password
REM RDP into TESTENV01
REM For the following line to work TESTENV01.rdp file should be present at the location
REM TESTENV01.rdp can be created form mstsc.exe using the necessary setting like the username password etc and then > SaveAs
START "" "D:\Automation utilities\TESTENV01.rdp"
REM Delay the batch execution for 10 seconds to allow the RDP to connect
PING 1.1.1.1 -n 10 >NUL
:START
REM Keep checking if RDP conection to TESTENV01 is closed by dumping the result of appropriate filter on TASKLIST into a text file and search for the text mstsc in it.
TASKLIST /svc /FI "WINDOWTITLE eq TESTENV*" /FI "STATUS eq running" /FO csv >temp.txt
TYPE temp.txt | FIND /i "mstsc"
ECHO Error Level = %ERRORLEVEL%
IF ERRORLEVEL 1 GOTO NOTRUNNING
IF ERRORLEVEL 0 GOTO RUNNING
:NOTRUNNING
ECHO No active RDP connection(s) to TESTENV01 exist
GOTO LOCKSYS
:RUNNING
ECHO Active RDP connection(s) to TESTENV01 exist
REM If connection to mstsc is running wait for 3 seconds and resume checking
PING 1.1.1.1 -n 10 >NUL
ECHO Wait of 3 seconds finished. Starting the check again...
GOTO START
:LOCKSYS
ECHO Deleting the temp files...
DEL temp.txt
ECHO About to lock the system....
rundll32.exe user32.dll, LockWorkStation