Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)
Hello,
I'm hoping to write a script in XP that would put a file onto a FTP
server and afterward, rename the file and move to to another locaton on
the hard drive. I try to user the following script that was written for
Windows 2K and it's not working.
REM *** Browse to files ***
REM *** FTP file to HOOD
ftp -i -n [ftp server]
user [username] [password]
cd [directory]
mput [location of file ie: c:\files\]
close
quit
REM **** Rename the file to a date format ****
@echo off
c:
cd [location of file ie. c:\files\]
if exist "Test" goto :start
echo File "Test" does not exist.
goto :EOF
:start
setlocal
set zdate=%date:~4%
set zdate=%zdate=%
set zdate=%zdate:~4,4%%zdate:~0,4%
set ztime=%time:~0,6%
set ztime=%ztime::=%
set ztime=%ztime: =0%
ren "Test" "Test.%~n1%zdate%%ztime%%~x1"
@echo on
REM **** Move the file to the current_feed directory ****
move /Y Test* [new location c:\test\backup\]
You are about to answer a thread that has been inactive for more than 6 months. If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.