HyperCopy - Applications
Copyright (C) by Wen-Jhy Sheen since Jun 1996(BIG5 Version Is Here)
[ Common Application | Scheduled Upload/Download | Run at Background - Instantly ]
Common Application |
Here, we assume a virtual host hikari as our demonstrative remote host, and a virtual directory c:\local as our demonstrative local directory. Usually, you can open a (DOS) prompt window and typein a hcopy command to execute it directly. Or, you can set a hcopy command for a system event, or put it inside a batch file to run unmannedly. Some examples:
- Only download the file at http://hikari/subdir/document.html
hcopy http://hikari/subdir/document.html c:\local- Want to download the whole directory structure under http://hikari/subdir/, including files and sub-directories
hcopy http://hikari/subdir/ -r c:\local- Want to download the whole directory structure under http://hikari/subdir/ , also relocate images, which is not under /subdir, but is refered from pages under /subdir, to /subdir. This is convenient for user to browse it locally
hcopy http://hikari/subdir/ -r -i c:\local- Want to download the whole directory structure under http://hikari/subdir/, but only HTML files (.htm or .html), not other type of files. Also, the default HTML filename is index.htm
hcopy http://hikari/subdir/ -r -y=*.htm? c:\local -h=index.htm- Want to download the whole directory structure under http://hikari/subdir/ , but don't want to download /subdir/dir0,/subdir/dir1,...,to /subdir/dirN. Also, don't want any ZIP file
hcopy http://hikari/subdir/ -r -x=/subdir/dir?/* -x=*.zip c:\local- Want to download the whole directory structure under ftp://hikari/subdir/ , but don't want ZIP files, also to terminate if failed and retried more than 10 times in some transfer
hcopy -retry=10 ftp://hikari/subdir/ -r -x=*.zip c:\local- Want to download all files under ftp://hikari/subdir/ , but don't want any file which is under any sub-directory named backup. Also, don't want to duplicate remote directory structure
hcopy ftp://hikari/subdir/ -r -x=*/backup/* c:\local -c-- Only want to download thie file ftp://kikari/subdir/sdir1/file1.arj, and don't want to duplicate remote directory structure
hcopy ftp://kikari/subdir/sdir1/file1.arj -c- c:\local- Want to download all files inside nntp://hikari/alt.binaries.pictures.anime , but don't want HTML (.htm or .html) or text files (.txt), also create a log file
hcopy nntp://hikari/alt.binaries.pictures.anime -x=*.htm? -x=*.txt c:\local -lHere are some configuration examples via -CFG option:
- Want to let the FTP proxy server default to proxy.mydomain, the HTTP proxy server default to 192.168.5.5:8080, also the default HTML filename default to index.htm, and save these options as global configuration permanently
hcopy -cfg+* ftp://proxy.mydomain http://192.168.5.5:8080 -h=index.htm- Want to delete the FTP proxy server and PASV mode configuration, also set the default work directory to d:/download, and save these options as current user's configuration permanently
hcopy -cfg+ ftp:// -pasv -w=d:/download- To display current user's command-line configuration
hcopy -cfg- To display global command-line configuration
hcopy -cfg*
Scheduled Upload/Download |
As a command-line utility, hcopy can be executed easily via a system timing event, such as Windows NT's built-in Schedule service. Hcopy can produce log files, which records everything happened during its executing period. All of these make it possible to perform an unmanned and trusty upload/download. Especially, users can select to upload/download unmannedly during midnight or a cut-price period to save time and money.
If dial-up is your only way to connect to the Internet, you can make use of Windows NT Remote Access Service (RAS) and Schedule service to dial up, download, and hang up unmannedly and on time. All you have to do is check hcopy's log file in the morning to see if everything is ok. This strategy gives you a better transmission quality and saves you more time on waiting and watching the screen. Next, we describe this method in detail.
The basic requirements for a timing download is simple and cheap:
- Windows NT's bulit-in Schedule service must be started, about this service, refer to http://www.fido.net.tw/nti/nt/nt40nt/NT&MSN/SCHEDULE.html (BIG5 only)
- Use Windows NT's built-in command at to set up hcopy events, or if you prefer a GUI experience, try Windows NT Resource Kit's winat utility, about these utilities, refer to http://www.fido.net.tw/nti/nt/nt40nt/NT&MSN/AT.html (BIG5 only)
- Yon can set up one hcopy command for one event, or put your hcopy commands into a batch file (.bat or .cmd) , and set up one event to call up that batch file
- Remember to add the option -L to the hcopy command-line, it requests hcopy to generate a log file
- To dial up unmannedly, use Windows NT's built-in command rasdial, this command only appears when Remote Access Service is installed. About rasdial commmand, refer to http://www.fido.net.tw/nti/nt/nt40nt/WANCONN/RASDIAL.html (BIG5 only)
One event executes only one command. If you want to dial up and download unmannedly, we suggest you put all your commands into one batch file, then set up one event to call up it. The following is an batch example named auto_download.bat:
@echo off
REM ------------ To dial up my ISP, if not succeed, keep on trying------------
:dial_again
rasdial MY_ISP my_ID my_password
if errorlevel 255 goto dial_again
REM ------------ Here are the download commands ------------
hcopy http://www.microsoft.com/nt/ c:/webpages/microsoft -r -l
hcopy ftp://ftp1.microsoft.com/msdownload/sp3/ c:/webpages/microsoft -r -l
hcopy nntp://news.hinet.net/alt.binaries.pictures.anime -l c:/anime
REM ------------ Hang up------------
rasdial /disconnect
In a batch file, if any character inside the URL of hcopy's command line is encoded into %hh style, one should replace the single '%' character in the given URL with two continuous '%' characters. Since the batch file interpreter has '%' as its own special use.
To setup up an event visually, we suggest you to use Windows NT Resource Kit's winat. The following winat screen shot sets up an event at 02:30AM tomorrow to run the above sample batch file:
About winat, refer to http://www.fido.net.tw/nti/nt/nt40nt/NT&MSN/CMDSCH.html (BIG5 only)
When using system's Schedule service to intrigue hcopy commands, hcopy owns the permissions of the account which is used to start up Schedule service, usually System account is the default. Please note that under such circumstances, hcopy should have enough permissions to read/write the local directory. If a local directory is not given, hcopy will store its files under its default working directory, usually the system directory. And if hcopy don't have enough permissions to access that directory, nothing will be stored. To avoid this, you should specify the local directory (given by local_path) in the command-line explicitly.
Run at Background |
Windows NT is a multi-tasking environment, which means many tasks can operate under the same computer at the same time. Sometimes, as you work under the (DOS) prompt window, you may want to key in another command before the previous command is executed completely. This means, you want the previous command to run at the background of the system, and don't want it to influence the user working one the foreground.
Windows NT Resource Kit's soon command provides you with the ability to instantly run a command at the background. This is especially useful when you are logoning a remote computer via Resource Kit's rcmd or other telnet client. Under such situation, you can issue commands one by one without waiting the completion of each of them. Also, you can logoff immediately with leaving commands running at the remote.
If you connect to the Internet via dial-up connections, you can issue commands by soon at the remote, then logoff and hang up immediately. Then, later, say one day after, you dial-up, logon, and check the result. This saves you more time on waiting and less payment on telephone bills.
The basic requirement for soon command is:
- Windows NT's built-in Schedule service must be started, about this service, refer to http://www.fido.net.tw/nti/nt/nt40nt/NT&MSN/SCHEDULE.html (BIG5 only)
The basic command-line syntax for soon combined with hcopy is as follows:
soon <seconds> "hcopy_command_line"
Where,seconds stands for the time to wait before the given command to be intrigued, hcopy_command_line is the common hcopy command to be executed. After you issue such a command, it will be intrigued after the specified seconds of time.
Some examples:
- soon 3 "hcopy http://hikari/subdir/document.html c:\mydest "
- soon 60 "hcopy http://hikari/subdir/ -r c:\mydest -L"
- soon 0 "hcopy ftp://hikari/subdir/ -r -x=*.zip c:\mydest"
- soon 0 "hcopy ftp://hikari/subdir/ -r -x=*/backup/* c:\mydest -L"
- soon 3600 "hcopy nntp://hikari/alt.binaries.pictures.anime -x=*.htm? -x=*.txt c:\mydest"
About soon, refer to http://www.fido.net.tw/nti/nt/nt40nt/NT&MSN/SOON.html (BIG5 only)
When using system's Schedule service to intrigue hcopy commands, hcopy owns the permissions of the account which is used to start up Schedule service, usually System account is the default. Please note that under such circumstances, hcopy should have enough permissions to read/write the local directory. If a local directory is not given, hcopy will store its files under its default working directory, usually the system directory. And if hcopy don't have enough permissions to access that directory, nothing will be stored. To avoid this, you should specify the local directory (given by local_path) in the command-line explicitly.