HyperCopy - Command-Line Syntax
Copyright (C) by Wen-Jhy Sheen since Jun 1996(BIG5 Version Is Here)

[ Command-line Syntax | Options | Errorlevel | Command-line Examples]

 

Command-line Syntax

hcopy <remote_URL> [local_path] [options] [-?]

Where:

remote_URL The remote URL. It has the same format as the World Wide Web does. The general syntax is protocol://[user_id[:password]@]host[:port][/path], where items enclosed by [ ] stand for optional. user_id and password are the ID and password used to logon to the remote server. If not given, they are default to anonymous and hcopy@somewhere.net. Hcopy now supports HHTP,FTP, and NNTP protocols. You can copy URLs from your favorite Web browser and paste into hcopy command line.
local_path The local path (file or directory) to stores the downloaded or uploaded files. The local path can be in your local storage device, or an Microsoft UNC (\\computer_name\share_name\path) representation. If not given, current work directory is used. If the local path is prefixed by a '-' character, please key in the '-' character twice. Hcopy will take these two '-' as one '-' .
options Optional options. Users may or may not give according to their needs. Documented as follows.
-? Display a page of hcopy's command-line syntax and all available options.

Special Notes!

Options

Every option of hcopy must be prefixed by a '-' character. Each option's order in the command-line is irrelevant, also , option name is case-insensitive. Their effects and scopes depend on the protocol type and are divided into the following option groups:

[ Common Options | FTP Options | HTTP Options | NNTP Options ]

  Common Option Description
-C[+|-|*] Whether or not to duplicate the source directory structure. '+' for yes (default), '-' for no. -C is equivalent to -C+. -C+ only duplicate the directory tree under the specified directory. However, The -C* will also duplicate the directory route above the specified directory.
  -CFG[+|-|~][*] Preserve (+) or reset (-) command-line configuration. Preserved information includes addressing information of proxy servers of different protocols and some options (marked ). When -CFG+ is given, each remote_URL is used to describe a set of proxy server information for FTP, HTTP, or NNTP.

Giving -CFG~ will make hcopy to ignore any configuration previously saved by -CFG+ in that session.

Giving
-CFG without a '+' or '-' attached will display the command-line configuration for current user.

An additional '*' will make hcopy to store, delete, or display the command-line configuration for global users in this computer. If '*' is not given, it's personal configuration. When any user in this computer executes hcopy, it will looks for that user's personal configuration first. If not found, hcopy adopts the global one.

Note!
  • The value ('+', '-', or appropriate string) of each option must be specified explicitly, or the record of that option will be erased.

  • Options given directly under the command-line possess higher priority than those saved via -CFG option.
  -F=<filename> Give the first uploaded or downloaded file a new file name. This option is more appropriate for a single-file uploading or downloading. (FTP and HTTP only)
-L[=path] Generate a log file. Where, path is the pathname of the log file, if path is not specified , the default log file name is "~hcopy.log". If path is specified, but only the file name part, no directory part, then the log directory is default to the directory that local_path specifies. If none of above, then default to current work directory.
-M[+|-] Whether or not to show the percent gauge of transfering progress of each file. '+' for yes (default), '-' for no. -M is equivalent to -M+.
-O[-|+|?] Whether or not to overwrite existing files. -O? will overwrites only when the source is newer than the target. -O- will tell hcopy not to overwrite any existing files. The option -O? 's purpose is to override the same option saved by -CFG.
  -P=<addr[:port#]> Specify the addressing information of a proxy server. addr is its domain name or IP address. port# is the port number where the proxy server provides its service.
-R[-|+|*] Whether or not to download recursively. '+' for yes, '-' for no (default) . -R+ only includes files and directories under the given remote_URL. -R is equivalent to -R+.
-R* also includes links outside the source directory, its real range depends on the protocol type.
-RETRY=<count#> Specify the maximum retrying times in each transfer. If this count is exceeded during any file session, hcopy will terminates. If count# is not given, 0 will be used. Default is un-limited.
-T[-|+] Whether or not to show the client/server talk in the session level. '+' for yes, '-' for no (default). -T is equivalent to -T+.
-W=<dir> Specify hcopy's work directory. When hcopy starts, it'll first switch to this directory then go on.
  -X=<pattern> Specify the URL path pattern to be excluded from downloading. The pattern here is used to match the complete URL path starting from the '/' character after the host address (and possibly the port number) to the end of the URL. Inside the pattern, '*' is used to match a cluster of any combination of some characters, '?' is used to match any single character. These two wildcards can be mixed together to perform a sophisticated filtering. For examples, */abc??.html, *.zip, */rfc/*.txt, /nt40nt/*.htm?.

More than one -X options can be specified to give more than one patterns.

Note!
  • If the protocol is NNTP, the patterns specified by -X or -Y options only match the file name part rather than the complete URL path.

  -Y=<pattern> Specify the URL path pattern to be included for downloading. If this option is specified, only those URLs which match the pattern given by -Y will be downloaded. The pattern of this option has the same syntax with -X's. This option can be used together with -X options.

More than one -Y options can be specified to give more than one patterns.


  FTP Option Description
-D=<filename> This make hcopy to (recursively) list remote FTP directory and store it into a formally formated directory list file. The filename is the name of the list file. The file name of the list can also be specified in local_path in the command-line. If the given one is an existing directory, or is ended in '/' or '\' character, the file name part adopts the default one. The default is "~dir.lst".
-E[-|+] After a successful get or put, whether or not to erase the source files/directories. '+' for yes, '-' for no (default). -E is equivalent to -E+. If enabled, hcopy moves files from the source to the destination.
-PASV[-|+] To support FTP's passive mode. By default, FTP client is passive to wait for the data connection from the server. When in passive mode, the roles exchange. PASV mode is useful for those having routers only allowing connections to be built from inside to outside.'+' for yes, '-' for no (default). -PASV is equivalent to -PASV+.
-R[-|+|*] -R* to include Unix-styled links.
  -U Perform FTP uploading.


  HTTP Option Description
-H=<filename> Specify the default HTML filename. This option is used for those URL pathes which end in an single '/' character, rather a filename. If not specified, the default one is default.html .
-HYP[-|+] Download hyper-linked objects not in the same site. The objects are limited to non-HTML files. The downloaded files will be placed in their referer HTML pages. '+' for yes, '-' for no (default). -HYP is equivalent to -HYP+.
-I[-|+] Whether or not to relocate those images, not under the remote URL, but refered from pages under remote URL, to the remote URL level of directory. '+' for yes, '-' for no (default). -I is equivalent to -I+. This option is convenient for user to browse it locally.
-R[-|+|*] -R* to include any linked in the same site
  -RCV Recovery last broken transfer. local_path should give the path name of the broken file.


  NNTP Option Description
-DEC[+|-] The '+' (default) will make NNTP decode files UU- or Base64-encoded inside any new post automatically. If -DEC- is given, hcopy will store new posts into a file in its original form. The file name of the stored file can be specified by local_path in the command-line. If the given one is an existing directory, or is ended in '/' or '\' character, the default file name is "group_name.msg" .
-FL=<file> specify the file name of the file description list which is created for decoded files when NNTP has completed its downloading. The default one is ~files.lst
-MIN=<#> Specify a minimum rows of posts to be taken care. Default is 0. When hcopy is scanning the newsgroup, only posts having enough rows more then the specified will be scanned. This will save much time on scanning samll posts that seems not possible to have encoded files inside.
-MSGID=<dir> Specify the directory to store Message-IDs of Netnews messages. If not specified, hcopy will create a directory named msgid under the local directory. Message-ID is unique for each message in the Internet. hcopy remember those Message-IDs of messages it ever processed, and never process them for twice.
  -OLD Mark all posts in the newsgroup as read, i.e., to remember all MSGIDs in that newsgroup but not decode or save posts.

 

Errorlevel

When terminates, hcopy will return an errorlevel for the calling batch file's IF ERRORLEVEL statements to branch. If executed successfully, or file not modified, or non-connection error (such as file not found) , hcopy returns 0. If failed, or the specified first file or directory doesn't exist, hcopy returns 255.

 

Command-line Examples

Here are some command-line examples of hcopy. For more vivid examples, please refer to HyperCopy Application Page:

 

...Please mail your comment to wjsheen@m2.dj.net.tw