Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SESSIONNAME Windows variable
Message
De
11/10/2012 17:07:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SESSIONNAME Windows variable
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01554855
Message ID:
01554855
Vues:
97
Hi all,

Have used GETENV("SessionName") in one spot in my code to detect if the user was logging on via a Terminal Server (RDS, 2008R2) and if so, automatically set some print options for them. (the user's fire up their app via a shortcut on their RDC desktop which points back to their app on another file server).

But it has been mis-behaving lately (or maybe it always did and they did not report it). Somtimes SESSIONNAME returns "RDP-Tcp#x" and sometimes it is empty. (it should return "Console" for non-RDC sessions). I put some code into their app to display the value of SESSIONNAME. Sometimes it is populated, other times it is not.

If I open a DOS prompt on the server, it is always populated. Likewise, if I launch the app by first launching a command session:

C:\Windows\System32\cmd.exe /c "F:\Claims\Mk.exe" (i.e. the shortcut)

It seems to always populate. (BTW, I figured that out as that was the only way I could get the app to be pinned to a Windows 7 taskbar, but that is another story).

Anyone know what's up with SESSIONNAME - or is there an easier, goof-proof way to detect if the user is in an RDC session?

Albert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform