How to use tscon on Windows7?
Solution 1:
Before I get to your primary issue I'd like to point out that the fact that you are getting the message
{ErrorPrintf(): LoadString failed, Error 15105, (0x00003B01)}
Error [15105]:The resource loader cache doesn't have loaded MUI entry.
is an indication that something has become corrupted on your system. MUI is the multilingual user interface. Is the Windows 7 computer in question set to use a language other than "English (United States)"? It looks like tscon is trying to find and display an error message in your configured language, but it can't find the language file that it should use. This may be a symptom of a larger problem. You're using tscon.exe that was installed on that computer and not one you copied from another computer, right?
You might be able to correct this problem by running sfc /scannow
after taking a snapshot and seeing if tscon gives the same error.
As for your primary issue, the number you are supplying to tscon indicates which session ID to act on. Have you checked if you are using session 0 or 1? Run query user
to see what your session ID is and then use that number.
For example, I get this output from query user
on one of my servers:
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
>starfish rdp-tcp#4 2 Active . 9/20/2012 10:12 PM
Since my session ID is 2, I run tscon 2 /dest:console
to send that session to the console. When I go to the console and run query user
I see the following:
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
>starfish console 2 Active . 9/20/2012 10:12 PM
I also tested this on a Windows 7 Pro desktop with the same results.
If you have success with the commands above, you can put the following into a batch file and run it to send your current session to the console.
for /f "skip=1 tokens=3 usebackq" %%s in (
`query user %username%`
) do (
%windir%\System32\tscon.exe %%s /dest:console
)
It should also eliminate the need to restart the computer, which I suspect was to make sure you always got session ID 0.
Solution 2:
This page says the issue is with the system being locked when trying to run it through scheduled tasks: http://www-01.ibm.com/support/docview.wss?uid=swg21304791
Setup the system to automatically login, disable the screen saver and automatic locking, and see if that helps. Don't connect to the machine through remote desktop - that will lock the console session. Install vnc to login instead or use whatever method your virtual machine software provides. In fact, turn off remote desktop so you can't lock the system by accident.
To setup autologin, run "control userpasswords2"
According to this: http://support.microsoft.com/kb/302801 Tscon would actually leave the session unlocked in server 2003 (and, presumably) xp. This was a bug that has likely been corrected in newer windows versions.