REMOTE FILE TRANSFER FOR CITRIX / RDS - FREEWARE

Remote File Transfer is a small utility that transfers file from the Terminal Server (Citrix or Remote Desktop Services ) to the client (local) machine, the file then can be:

  • opened with the default associated program installed on the client machine.
  • printed on the default printer installed on local machine.
  • attached to a new Outlook email on local machine like Send to Mail recipient
  • from MS Word via a macro, provide Send document as attachment to local machine

This program can also be configured to provide host-to-client Content Redirection feature like with Citrix XenApp for any type of file.
For example, from an Outlook email, when double clicking on an MS Word or PDF attached file, the file will be transferred to local machine and opened with the default associated program.

Notes: for Citrix, the FREEWARE version of Remote File Transfer works only with Windows 2008/R2 and previous version. A commercial version with no limit is available. Email to request a demo version.

 

USING

From a remote session, on the Citrix or Remote Desktop Server, open a DOS command prompt and type:

RemFileTransfer.exe /S:SourceFileOnServer /D:DestinationFolder /O:Operation

Where:

SourceFileOnServer: The full path file name on the server to copy to client side

DestinationFolder: Optional - a folder on the client machine where the file will be copied to. If DestinationFolder is omitted, the file will be transferred to %TEMP% folder on the local machine.

Operation: Optional – can be one of these values:

T: Transfer file from server to local only, do not open.

O: Open the file with the default associated program after transferring. This is the default option if the parameter is omitted.

P: Print the document file on default printer attached to local machine  

M: Attach file to a new Outlook email on the local machine (like Send To Mail Recipient context menu)

 

Example: from a DOS Command line type:

RemFileTransfer.exe /S:C:\Temp\PictureTest.jpg /D:C:\Temp\ /O:O

The file C:\Temp\PictureTest.jpg on Terminal Server will be copied to C:\Temp\ on the client (local) machine. The file will be opened in default Image Viewer on the local machine.

DestinationFolder can be an environment variable on the client machine, but it must be used with ^ escape character, i.e:

RemFileTransfer.exe /S:C:\PictureTest.jpg /D:^%USERPROFILE^%\Temp\ /O:O

Except O(pen), options T(ransfer), P(rint) and M(ail), multiple files can be used. File name must be separated by a semi colon. ie:

RemFileTransfer.exe /S:C:\File1.doc;C:\File2.doc /O:M

 

On the server, there are 3 commands added to Windows Explorer context menu. When right click on a file, user will have option to Send the file to attach to local Outlook email (Send to local Mail recipient) or to Print the file on default printer installed on local machine or Open the file on local machine.

 

CONTENT REDIRECTION CONFIGURATION

If you want to configure RemFileTransfer.exe for using as Server-to-Client redirection for some file types (as with Citrix), Ex: for .jpg JPEG picture file type, follow these steps:

- Use Regedit.exe to edit the registry.

   WARNING: IF YOU ARE NOT SURE ABOUT THIS, DON'T DO IT.

  1. Find HKEY_CLASSES_ROOT\.jpg and rename it to HKEY_CLASSES_ROOT\.jpg_bak
  2. Recreate the key HKEY_CLASSES_ROOT\.jpg
  3. Add the new keys HKEY_CLASSES_ROOT\.jpg\shell\open\command
  4. Edit the default value, change it to:

         RemFileTransfer /S:%1

         If you want to specify a destination folder on the local machine:

         RemFileTransfer /S:%1 /D:FolderOnLocal

    In the registry, if using Environment Variable, use ^ escape character:

    RemFileTransfer /S:%1 /D:^%USERPROFILE^%

     

 

From now, during a remote session (RDP) every time when you double click on a JPEG picture file, it will be transferred to and opened on the client machine using the default associated program on the client side.

With this configuration, inside Outlook, when you double click on a Jpeg attached file, that file will be transferred and opened on the client machine as well.

Repeat the same steps for any type of document file that you want as .doc, .xls, .pdf, etc.

 

MS WORD MACRO FOR Send As Attachment ON LOCAL MACHINE

Create a MS Word macro on the server side to add option Send As Attachment to local. This feature works as Word standard Send as attachment, but the file will be transferred to local machine and attached in a new email on the local machine.

Add this macro to MS Word:

'********************************************************************************************************

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Sub SendtoLocalMailRecipient()
Dim oFso, sTempFile, iStart, iEnd

  sTempFile = Environ("TEMP") & "\" & Application.ActiveDocument.Name
  Set oFso = CreateObject("Scripting.FileSystemObject")
  If oFso.FileExists(Application.ActiveDocument.FullName) Then
     oFso.CopyFile Application.ActiveDocument.FullName, sTempFile, True
     Shell "RemFileTransfer.exe /S:" & sTempFile & " /O:M"
     
    iStart = Timer
    iEnd = Timer
    Do
       DoEvents: DoEvents: DoEvents: DoEvents: DoEvents
       Call Sleep(500)
    Loop While (iEnd - iStart) < 10 And IsFileInUse(sTempFile)
    
    oFso.DeleteFile sTempFile
  End If
  'MsgBox ActiveDocument.FullName
  'MsgBox ActiveDocument.Name
 
 
End Sub

Public Function IsFileInUse(ByVal pFileName As String) As Boolean
    Dim intFile As Integer
    
    intFile = FreeFile(0)
    On Error Resume Next
    Open pFileName For Input Lock Read Write As #intFile
    If Err Then
        IsFileInUse = True
    Else
        IsFileInUse = False
    End If
    Err.Clear
    Close #intFile
End Function

 

DOWNLOAD

MQ Technologies
Specialized in Citrix/RDS Virtual Channel Solution
Montreal, Quebec
CANADA
linkedin

© 2006-2017 MQ Technologies