BAT script Help!

Forum Windows XP : Windows XP General Discussion - BAT script Help!

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

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\]

Thank you!


--
ck1763

Sponsored Links
Register or log in to remove.
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > BAT script Help!
Go to:

There are 1089 identified and unidentified users. To see the list of identified users, Click here.

Please mind

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.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them