if one shares VC config cross multiple PCs (I use onedrive to sync it across 2 PCs), one might need to do things based on which PC VC is running on. Example: setting the microphone to listen to, or if the PCs are in different rooms, commands like "Lights On" will mean to turn different lights on ...etc.
here is a very simple and easy command to capture the PC name in a variable.
update: the command has been revised to store as well the current user name ... on XP requires service pack 2, and I kept the original as disabled for reference
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="867" name="Get PC & User name" 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\hostname.exe</param>
<param />
<param>true</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>PCName</param>
<param>{LastResult}</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>Launch.Capture</cmdType>
<params>
<param>C:\Windows\System32\whoami.exe</param>
<param />
<param>true</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>(.*?)\\(.*)</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>PCName</param>
<param>{Match.1.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>UserName</param>
<param>{Match.1.2}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<event>Windows.GetPC-UserName</event>
</command>