kemarin di kantor butuh untuk kirim file otomatis melalui PC ke PC lainnya dengan OS windows 98 di PC sumbernya. solusi paling mudah adalah dengan menggunakan Bacth Commandagar dapat berjalan di windows 98. akhirnya setelah searching sana-sini, ketemu dech solusinya, dengan cara membuat dua file (yang pertama file batch untuk connect ke FTP server, yang kedua file yang isinya command FTP).
pertama-tama buatlah sebuah file batch (selahkan buat menggunakan Notepad), dengan nama file "Command_Ftp.bat" yang isinya:
After you have signed on here is some FTP commands:
pertama-tama buatlah sebuah file batch (selahkan buat menggunakan Notepad), dengan nama file "Command_Ftp.bat" yang isinya:
REM Perintah ini untuk Upload All file secara otomatis ke FTP server tertentuUntuk yang kedua, buat file yang berisi command ftp, kita beri nama file "cmd.ftp"
CLS
@echo off
:: variables
set drive="C:\Log_SendFtp_"
SET dateNtime="%date:~10,4%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%"
rem "Fri 03/12/2010---------10:37:26.27"
echo "************************************************" >> %drive%(%dateNtime%).txt
date /t >> %drive%(%dateNtime%).txt
time /t >> %drive%(%dateNtime%).txt
echo
echo "******** Begin ********" >> %drive%(%dateNtime%).txt
echo
ftp -i -s:[command_file_ftp] [FTP_server] >> %drive%(%dateNtime%).txt
ECHO Y | DEL C:\[Nama_Folder]\. >: NUL >> %drive%(%dateNtime%).txt
echo
echo "******** End ********" >> %drive%(%dateNtime%).txt
echo
date /t >> %drive%(%dateNtime%).txt
time /t >> %drive%(%dateNtime%).txt
echo
echo "************************************************" >> %drive%(%dateNtime%).txt
[ftp_user_id]
[ftp_user_password]
mput C:\[Nama_Folder]\*.*
quit
Command Line Syntax
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [host] | ||
where: | ||
-v | Suppresses display of remote server responses. | |
-n | Suppresses auto-login upon initial connection. | |
-i | Turns off interactive prompting during multiple file transfers. | |
-d | Enables debugging. | |
-g | Disables filename globbing (see GLOB command). | |
-s:filename | Specifies a text file containing FTP commands; the commands will automatically run after FTP starts. | |
-a | Use any local interface when binding data connection. | |
-A | Login as anonymous. | |
-w:buffersize | Overrides the default transfer buffer size of 4096. | |
host | Specifies the host name or IP address of the remote host to connect to. |
- help
- gives a list off FTP commands. - help [command name] - give brief help.
- ? [command name] - give brief help.
- open [server name] - opens a connection to a new web server.
- disconnect - terminates ftp session.
- bye - logoff & exit FTP.
- exit - Terminate FTP session and exit.
- lcd [directory name] - Change local working directory.
- cd - change remote working directory (at FTP site).
- get [filename] - download a file to your local working directory.
get- will prompt for remote-file, then local-file. - mget *.* - Get multiple files. If prompt is on, will prompt Y/N for each file matching the wildcard.
prompt- toggles prompting on or off. ON by default. - put [filename] - upload a file to the web server.
put- will prompt for remote-file, then local-file. - mput *.* - Put multiple files. If prompt is on, will prompt Y/N for each file matching the wildcard.
prompt- toggles prompting on or off. ON by default. - pwd - shows your current working directory on the remote server.
- mkdir [directory name] - creates (make) a new directory on remote server.
- rmdir [directory name] - removes (delete) a directory on remote server - if empty.
- delete [filename] - deletes a remote file.
- user [username] - changes current user on current server
- quote
- sends a command to the ftp server. - binary - switches to binary file transfer mode.
- hash - This is to show you the progress of the upload.
- ls or dir - List contents of remote directory.
Artikel yg menarik silahkan cek juga artikel kami Fastest and Lightweight Linux Distro For Old Computer
ReplyDelete