Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Windows Directory Listing Using a Batch File - Returned File

This example builds on the example illustrated in Windows Directory Listing Using a Batch File - Default Directory.

Keep in mind that both the batch file and the file created by the redirected output reside on the remote system.

set
set
open
exec
cd
cd
attrib
copy
exec
quit

Due to the complexity of this example, each line (numbered for your convenience) is explained, below.

  1. Echo is turned off to minimize the amount of information in the transaction log due to its size. You are encouraged to set up the example and work through the transaction log.
  2. Set a variable, outdir, for later use. Instead of setting the variable inside of the UDM script, the variable and its associated value could have been provided externally via a script option.
  3. Open the UDM connection for a two-party transfer. The manager will act as the primary server and is known as local.
  4. Execute the remote command passing the full path to the file for the redirected output. Note the use of the variable inside of the double quotations; this is a UDM feature.
  5. Change the directory for the remote system to the directory in which stdout.txt resides.
  6. Change the directory for the local system to the location in which you want stdout.txt to reside.
  7. Set the attribute for the local system to allow replacement of the incoming file.
  8. Perform the file copy.
  9. Execute a command on the local system to display the contents of the received file. UCMD server runs on the local system just as it would on the remote system to execute the command.
  10. Quit and exit the UCMD Manager.


The winxmp.bat batch file now echoes the received parameter. This puts output into the transaction log so that you can see what was passed to the remote system. The second line performs the dir command and redirects output to stdout.txt.

echo
dir


Output sent to stdout.txt.

UDM exec Command Parameters

The exec command parameters used in this example are:

Parameter

Description

cmd

Command to execute on the remote system using command type cmd (command).

user

Remote user ID with which to authenticate and execute the command on the remote system.

pwd

Password with which to authenticate the user ID on the remote system.

Components

Universal Data Mover Manager for Windows

Universal Command Server for Windows

  • No labels