How to Fix “CRFCN0557E: Activation Failed” Error in RFT Automation on Windows 7 Using Tscon.exe


2 views

When migrating Rational Functional Tester (RFT) automation from Windows XP to Windows 7, many developers encounter the frustrating CRFCN0557E: Activation failed when running under a Terminal Services environment error. This typically occurs when running RFT scripts via remote desktop or after system reboot.

The traditional fix using tscon.exe 0 /dest:console that worked perfectly on Windows XP behaves differently on Windows 7 due to:

1. Changes in terminal services architecture
2. Different session handling mechanisms
3. Enhanced security restrictions in Win7
4. MUI (Multilingual User Interface) resource loading changes

Here are tested approaches that have worked in production environments:

1. Alternative Tscon Syntax

tscon.exe RDP-Tcp#0 /dest:console /v
tscon.exe %SESSIONNAME% /dest:console

2. PowerShell Automation Script

# Run this after remote desktop disconnect
$session = ((quser) -split '\s+')[2]
tscon $session /dest:console

# Alternative using session ID
$sessionId = (qwinsta | Where-Object { $_ -match 'rdp' } | ForEach-Object { ($_ -split '\s+')[2] })
tscon $sessionId /dest:console

3. Scheduled Task Workaround

Create a task that runs at system startup with highest privileges:

schtasks /create /tn "RFT Session Fix" /tr "tscon.exe 1 /dest:console" /sc onstart /ru SYSTEM

If basic solutions fail, try these deeper diagnostics:

1. Check actual session IDs with: query session
2. Verify terminal services status: sc query termservice
3. Examine RFT logs for exact error context
4. Test with different remote desktop clients

For large-scale automation environments:

- Create Group Policy to auto-console sessions
- Modify RFT shortcut to include session reset
- Consider virtual machine templates with pre-configuration
- Implement monitoring to detect session issues

The key is finding which session ID or name actually corresponds to your automation session, as Windows 7 handles these differently than XP. The PowerShell approach tends to be most reliable across different environments.


When migrating from Windows XP to Windows 7 for automation testing with Rational Functional Tester (RFT), many developers encounter the frustrating CRFCN0557E: Activation failed when running under a Terminal Services environment error. While tscon.exe 0 /dest:console worked perfectly in XP environments, Windows 7 presents new challenges with different error responses.

Windows 7's tscon implementation differs significantly from XP:

Windows 7 output:
{ErrorPrintf(): LoadString failed, Error 15105, (0x00003B01)}
Error [15105]:The resource loader cache doesn't have loaded MUI entry.
Error [0]:The operation completed successfully.

Windows XP output:
Could not connect sessionID 0 to sessionname console, Error code 7045
Error [7045]:The requested session access is denied.

After extensive testing, here are the most reliable approaches:

1. Session Management Workarounds

Create a batch script to handle session management:

@echo off
:: Pre-test session reset
query session > session.txt
for /f "tokens=2" %%i in ('type session.txt ^| find "Active"') do (
    tscon %%i /dest:console
    timeout /t 5
)
del session.txt

2. Alternative to Tscon: PowerShell Approach

For Windows 7 specifically, PowerShell provides better control:

# Windows 7 RFT session reset script
$session = ((quser) -split "\s+")[2]
if ($session -ne $null) {
    tscon $session /dest:console
    Start-Sleep -Seconds 3
}

For overnight testing scenarios, implement this comprehensive solution:

:: Complete automation prep script for Windows 7
@echo off
:: 1. Disable screen saver
reg add "HKCU\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f

:: 2. Reset terminal session
for /f "skip=1 tokens=3" %%s in ('query session %USERNAME%') do (
    tscon %%s /dest:console
)

:: 3. Launch RFT with proper environment
set RFT_OPTS=-Dcom.rational.test.ft.exec.optimizeTerminalServerSession=true
start "" "C:\Program Files\IBM\SDP\FunctionalTester\bin\irft.exe" %*

For environments where you control the Windows 7 image:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
"TSEnabled"=dword:00000001
"fDenyTSConnections"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"SecurityLayer"=dword:00000001
"UserAuthentication"=dword:00000001