RDM Variables into cmd

Hello. I am trying to build a .bat file for RDM to remotely access workstations using RDP shadow.Right now, we use this script, it interacts with us and asks for computer name and then for session number:

Sorry for the long delay, i tested several possibilities for this one, as i wanted to do it through your .bat file.

I have been able to achieve this with a PowerShell (Local) Macro/Script/Tool.Create a new entry, in Macro/Script/Tool, PowerShell (Local), select Embedded Script, Click on Edit embedded Script.In the dialog box, I entered this script :

Thank you for a reply.I would like to have the ability to see user sessions in case, multiple users are logged on to computer. query session /server:%rcomp% did it before. However, powershell does not seem to have such command.