Author Topic: Make VC aware if you are connecting through RDP or Local...  (Read 1730 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Make VC aware if you are connecting through RDP or Local...
« on: December 29, 2014, 07:09:20 PM »
I access my VC PC a lot through RDP using my PC at work, or my desk ... and if I have something on full screen mode (like XBMC) then I see nothing... so I figured this to inform VC that I am connecting through RDP and it will shutdown or send window mode key to XBMC ...

to achieve that, a windows task inform VC that a user connected to PC (attached windows task scheduler xml file)... VC run bat file to determine the type of the session ... then take action ...

to make it happen import the attached xml as a task in windows task scheduler ..
create a bat file with one line of code: (I couldn't figure a way to use launch.capture with cmd)
@echo %sessionname%
- no need for batch file anymore command revised

save it somewhere and fix the path and the name in the VC command below ...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.9-->
<command id="305" name="Windows User Connect" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.Capture</cmdType>
    <params>
      <param>c:\windows\system32\cmd.exe</param>
      <param> /c "echo %sessionname%</param>
      <param>True</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;RDP-Tcp</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Remote Desktop</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VcAdvanced.Log</cmdType>
        <params>
          <param>put commands to switch XBMC to windowed</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Window.Focus</cmdType>
        <params>
          <param>xbmc</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>SendKeys</cmdType>
        <params>
          <param>\</param>
        </params>
        <cmdRepeat>0</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Local Consol</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VcAdvanced.Log</cmdType>
        <params>
          <param>put commands to switch XBMC to full screen</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>Windows.UserConnected</event>
</command>
« Last Edit: June 09, 2016, 04:08:31 AM by Haddood »
When Voice command gets tough, use hand gestures