HKEY_CURRENT_USER\Software\Cakewalk Music Software\SONAR Producer\Cakewalk VST
(And I think HKEY_CURRENT_USER\Software\Cakewalk Music Software\SONAR Producer\Cakewalk VST (x64) for 64 bit version, but I don't have that installed).
This includes the VST path.
So...
i) Set up X2 and run scanner
ii) Export registry key (say vst_x2.reg)
iii) Delete registry key
iv) Set up X3 and run scanner
v) Export registry key (say vst_x3.reg)
vi) Delete registry key
Batch script would be something like (X2.bat):
reg delete \\HKCU\Software\Cakewalk Music Software\SONAR Producer\Cakewalk VST /f
reg import vst_x2.reg
C:\program files (x86)\Cakewalk\SONAR X2 Producer\sonarpdr.exe
Not nice, and you'd need to go through (ii), (iii), (v), (vi) every time you wanted to add/delete plugins.