Files transfer automation thru Batch file on W2k

N

netadmin

8:52 AM 2/4/2004

Subject: Files transfer automation thru Batch file on W2k

Hi !!!

Anybody can help me to do automation of the below
requirements using simple batch file

1) On local pc,getting files from ftp server with
authentication
2) creation of new sub directory on remote nt server
3) Transferring downloaded files to remote nt server sub
directory



Regards
Mangapathi
 
P

Paul R. Sadowski

Lacking more specific information...

ftp -s:c:\FTPScript.txt
md \\Servername\MyShare\MyDir
move c:\downloads\*.* \\Servername\MyShare\MyDir /Y

Where FTPScript.txt is something like:
o ftp.someserver.com
myusername
mypass
lcd c:\downloads
cd /remotedir/somedir
prompt
bin
mget *.*
close
quit
 
M

Mangapathi

Thank you for your batch file. Batch file is working fine
till ftp script, but for the below steps, i am getting
error message " Logon failure: unknown user name or
bad password.".

md \\Servername\MyShare\MyDir
move c:\downloads\*.* \\Servername\MyShare\MyDir /Y


For the above commands,i.e. \\servername(Remote server)
how to mention useranme & password
for authentication in batch file. Could u help me.

Regards
Mangapathi
 
W

Wadester

Mangapathi [[email protected]] posted:
Thank you for your batch file. Batch file is working fine
till ftp script, but for the below steps, i am getting
error message " Logon failure: unknown user name or
bad password.".

Where Paul mentioned "myusername" and "mypassword", he was meaning that
you should substitute a working username and password on your FTP
server. If you run Paul's script verbatim, it will fail as you posted.


ws
 
P

Paul R. Sadowski

Mangapathi said:
Thank you for your batch file. Batch file is working fine
till ftp script, but for the below steps, i am getting
error message " Logon failure: unknown user name or
bad password.".

Change myusername and mypass to the username and password you need to login
to the ftp server.
md \\Servername\MyShare\MyDir
move c:\downloads\*.* \\Servername\MyShare\MyDir /Y


For the above commands,i.e. \\servername(Remote server)
how to mention useranme & password
for authentication in batch file. Could u help me.

Try this. Pick a free drive letter such as X then do this instead

net use x: \\Servername\ShareName yourusername yourpassword
md x:\MyDir
move c:\downloads\*.* x:\MyDir /Y
net use x: /delete

Where "yourusername" and "yourpassword" are the username and password you
need to use to access the share. Also set the permissions on the batch file
so no one who shouldn't see your password can't see it.
 
A

Al Dunbar [MS-MVP]

Wadester said:
Mangapathi [[email protected]] posted:
Thank you for your batch file. Batch file is working fine
till ftp script, but for the below steps, i am getting
error message " Logon failure: unknown user name or
bad password.".

Where Paul mentioned "myusername" and "mypassword", he was meaning that
you should substitute a working username and password on your FTP
server. If you run Paul's script verbatim, it will fail as you posted.


ws

....

From where I was standing, I could see directly into the eye of the great
fish. [JERRY: Mammal.] Whatever.
 
W

Wadester

Al Dunbar [MS-MVP] [[email protected]] posted:
Wadester said:
Mangapathi [[email protected]] posted:
Thank you for your batch file. Batch file is working fine
till ftp script, but for the below steps, i am getting
error message " Logon failure: unknown user name or
bad password.".

Where Paul mentioned "myusername" and "mypassword", he was meaning
that you should substitute a working username and password on your
FTP server. If you run Paul's script verbatim, it will fail as you
posted.


ws

...

From where I was standing, I could see directly into the eye of the
great fish. [JERRY: Mammal.] Whatever.

As if sensing my presence, he let out a great bellow. I said, "Easy, big
fella!"
 
A

Al Dunbar [MS-MVP]

Wadester said:
Al Dunbar [MS-MVP] [[email protected]] posted:
Wadester said:
Mangapathi [[email protected]] posted:

Thank you for your batch file. Batch file is working fine
till ftp script, but for the below steps, i am getting
error message " Logon failure: unknown user name or
bad password.".

Where Paul mentioned "myusername" and "mypassword", he was meaning
that you should substitute a working username and password on your
FTP server. If you run Paul's script verbatim, it will fail as you
posted.


ws

...

From where I was standing, I could see directly into the eye of the
great fish. [JERRY: Mammal.] Whatever.

As if sensing my presence, he let out a great bellow. I said, "Easy, big
fella!"

LOL! one of my favourites to. But let's not burden the ng with this any
further:

http://www.interleaves.org/~rteeter/seinstry.html

/Al
 
M

Mangapathi

i mean not for ftp. for remote nt server
authentication,how to define in batch file means with
syntax.

Regards
Mangapathi
 
M

Mangapathi

How to create directory with system monthyear from the
batch file.
eg.1. monthend-jan04
2. monthend-feb04

Could u help me.
 
J

Jerold Schulman

Using the Universal Date Parser, UnivDate.bat, from tip 4835 in the 'Tips &
Tricks' at http://www.jsiinc.com, and MMM.bat from tip 6837:

In the beginning of you batch file:

call Univdate
set /a year=10000%yy%%%10000
if %year% GTR 99 set year=%yy:~2,2%
call MMM M3


Ten to create a directory:

md monthend-%M3%%year%







How to create directory with system monthyear from the
batch file.
eg.1. monthend-jan04
2. monthend-feb04

Could u help me.


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
P

Paul R. Sadowski

Mangapathi said:
i mean not for ftp. for remote nt server
authentication,how to define in batch file means with
syntax.

By mounting the remote share as a local drive you are loged in...

net use drive share user password

ftp -s:c:\FTPScript.txt
rem Pick a free drive letter such as X
net use x: \\Servername\ShareName yourusername yourpassword
md x:\MyDir
move c:\downloads\*.* x:\MyDir /Y
net use x: /delete

Where FTPScript.txt is something like:
o ftp.someserver.com
myusername
mypass
lcd c:\downloads
cd /remotedir/somedir
prompt
bin
mget *.*
close
quit

Where "yourusername" and "yourpassword" are the username and password you
need to use to access the share. Also set the permissions on the batch file
so no one who shouldn't see your password can't see it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top