Passing variables from remote desktop session to local machine running the session.

Posted on 2007-10-04
Last Modified: 2013-11-21
Need to pass variables from a Microsoft Remote Desktop session ( server2003to the OS and applications of the local workstation (2000 or xp) running the remote desktop session.

 The application running on the remote desktop session is a Delphi exe accessing a paradox file.

 We need the remote desktop application to pass data that tells the local desktop what application to open  ( MSWord, MSExcel, Adobe, etc)  and what file to get.

We do not want to install these MS applications on the remote desktop machine.

When the user chooses a record in the remote desktop Delphi application, the local workstation  opens the correct application locally  ( not remote desktop) and loads the correct file.

Question by:humantouch
    LVL 22

    Accepted Solution

    Two things come to mind.
    1. You could use the clip-board to copy and paste the contents of the variables to get them from one environment to the other
    2. Write the contents to a file and then either copy the file from the remote to the local and access the file or you can map a drive from the remote to the local and write the file directly to the local machine and then read the information you need from the file.
    LVL 9

    Expert Comment

    This isn't something that can be done out of the box, it's going to require some pretty extensive customizing.  This may go a little beyond what I'm able to provide via this forum but let's start with some basics -

    1. what user account is being used on the XP client running MSTSC.EXE?
    2. what user account is that user logging on to the terminal server as?
       - are they in the same domain/forest?
    3. are you permitting the redirection of the client's local drives into the terminal session?

    Author Comment


    Clipboard solution sounds possible, how do we get the local desktop to take over once the clipboard has been loaded with the data?

    What is the trigger on the local machine that opens the local app and loads the required file?

    not using domain

    I see problems trying to run app from local drive from the remote desktom
    LVL 9

    Expert Comment

    I can't help you if you don't answer my questions ...

    Author Comment

    ms -
    questions 1, 2 using identical user account as the user account on  the server hosting the remote desktop.

    we dont use domain, only work groups.  

    question 3. As of now, we do not redirect the local drive to the remote desktop session. Howeve, both local desktop and the remote desktop session have access to the server's drives.

    LVL 3

    Assisted Solution

    You could make use of Terminal Server Virtual Channels. Documentation can be found on MSDN:

    Delphi Translations of the required functions API's can be found in the Jedi Apilib (jwWtsApi32):

    See here for a sample that transfers files through a Virtual Channel (C#):
    LVL 3

    Expert Comment

    If you want to go for the clipboard solution you can monitor the clipboard for changes with the SetClipboardViewer API.
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    My previous article  ( one possible method to get SCCM 2007 installed an…
    Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found here: http://www.experts-exchang…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now