PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Using INVOKE with Windx on remote RDP users  (Read 2164 times)

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Using INVOKE with Windx on remote RDP users
« on: January 20, 2022, 11:12:38 AM »
I'm new to setting up windx on remote RDP and need help.  I'm testing demo PXPlus Base on a 'cloud' Windows Server 2019 with our users logging in via remote RDP.  I also installed Windx on the Windows Server 2019 to use with *nthost.

Each user has their own presented RDP desktop.  On the first user's RDP desktop I created a Windx shortcut to run our start up program and it runs ok.  The INVOKE in *nthost brings up a windx screen on this user's rdp desktop like I want, and runs our code ok.  Except when our program executes INVOKE to open a freeware notepad- the notepad appears on the server desktop, not the user's RDP desktop where I want it to appear.

Usually I'm setting up nthost or cs on local PC's on a LAN.  What am I doing wrong or need to change with the RDP desktops?  The way our code works is that it will open the freeware notepad by pc name location, so that notepad, installed on each LAN PC, appears on the windx PC that invoked it.  Our code:

IF NID=%LPC_COMPUTERNAME$ THEN INVOKE QUO+LSERVER$+QUO+" "+QUO+F$+QUO
IF NID<>%LPC_COMPUTERNAME$ THEN INVOKE "[WDX]"+quo+LCLIENT$+QUO+" "+quo+F$(6)+QUO

This is not working for rdp desktop.  I can also just use notepad.exe and not the freeware.  How to have the code recognize the rdp user and invoke on that user's desktop?  Thanks.

Mike Flemmer
BASIC PC SOLUTIONS

Stéphane Devouard

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: Using INVOKE with Windx on remote RDP users
« Reply #1 on: January 20, 2022, 11:54:04 AM »
Mike

Many moons ago, I was using env("clientname") to identify workstations in Citrix/TSE environments
You may want to try it and see if that works for you

Regards
Stéphane Devouard
Portfolio | Work

michaelgreer

  • Diamond Member
  • *****
  • Posts: 129
    • View Profile
Re: Using INVOKE with Windx on remote RDP users
« Reply #2 on: January 20, 2022, 12:30:17 PM »
Mike,

I would be suspicious of how your %LPC_COMPUTERNAME$ is being set. Assuming that you *always* want the notepad or freeware on the client PC you can detect wdx with this code: IF MID(MSE,22,1)>$00$ AND MID(MSE,22,1)<$FF$.  If this is not $00$ or $ff$ then you are on windx.  You could also test by connect from RDP and just issue your invoke with no conditional and see where the notepad launches.

Michael

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Using INVOKE with Windx on remote RDP users
« Reply #3 on: January 25, 2022, 09:12:17 AM »
Thanks for the replies.  I will try those suggestions when I can.  Right now I have limited time to work on it as they have to use our software during the day. 

This is the only customer I believe that is running remote desktop in desktop mode, and INVOKE works ok in our current software in ProvdeX 5.0.  Just not in demo PxPlus.  However I have another customer running PxPlus using RDP in program app mode, and INVOKE works ok using RDP that way.

I haven't tested RDP in program app mode yet because the tech didn't know how to set it up for me.  I might have it today.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Using INVOKE with Windx on remote RDP users
« Reply #4 on: January 25, 2022, 09:47:56 AM »
Have you tried the following:

INVOKE "[lcl]XXXXXXX.exe"
(where XXXXXX is the name of the Executable you want to run)

Basically with PxPlus you can prefix the INVOKE command string with "[lcl]" and if the system is running WindX the command will be routed to the WindX to run. 

Now you have to make sure the program have been installed on the workstation (or in your case the workstation RDP environment) and that you have the correct pathname / PATHing rules.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Using INVOKE with Windx on remote RDP users
« Reply #5 on: January 26, 2022, 12:01:13 AM »
They finally setup my RDP and I was able to test what's happening.  I don't know if I need to create a ticket, but I can work around the issue.

I'm using INVOKE to run freeware notepad prolix.exe and it's located in a directory path that has no spaces, which runs ok in both ProvideX and PxPlus.  Somehow an older version of my prolix device was running it from PxPlus working directly, which does have spaces in it's directory path:

C:\PVX Plus Technologies\PxPlus 2019 Upd 2\locals\prolix\prolix.exe

In testing I found that if an INVOKE directory path has spaces ProvideX 5 runs ok, but not PxPlus.   This line of code runs ok in ProvideX 5.0 but in PxPlus "cannot find" pops up. See attached snaps:

0020 INVOKE "[WDX]C:\BASIC PC SOLUTIONS\COMMON\Prolix\PROLIX.EXE"

The spaces are ok in Providex, but not in PxPlus?

The user had no problem because they are currently on ProvideX and I'm testing demo PxPlus and found prolix would not appear on their windx run desktop.  I can rewrite my prolix device code to point to a no-space directory path and PxPlus will run ok in [WDX], and appears on their desktop correctly.   At this point I think I'm ok.  Thanks.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Using INVOKE with Windx on remote RDP users
« Reply #6 on: January 26, 2022, 08:38:41 AM »
As per Windows standards, put quotes around the EXE pathname as in


0020 INVOKE "[WDX]"+quo+"C:\BASIC PC SOLUTIONS\COMMON\Prolix\PROLIX.EXE"+quo
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Using INVOKE with Windx on remote RDP users
« Reply #7 on: January 27, 2022, 08:34:25 AM »
Mike, that's solves it, thanks! 

Also, I'm aware Providex is not supported and upgrading to PxPlus requires some code changes.  But it's worth it.  PxPlus is amazing. With many new features and capabilities.

I have an 18 user PxPlus user with many of them logging into remote desktop.  Initial setup log-in issues they had were caused by their cloud server, not PxPlus.  After they upgraded the server it's been running very smooth.