batch file help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a batch file that copies files from one server to the other
& should kind of do the following;

Ask me for the server name & then I input it.
Ask me for the username & then I input it

Then this copies the files to the other server so it will;

Ask me the server name to & then I input it.
Ask me for the username & I input it

I have tried finding a newsgroup for DOS but I can't find it.
If you can help thanks in advance

James
 
James said:
I want to create a batch file that copies files from one server to the other
& should kind of do the following;

Ask me for the server name & then I input it.
Ask me for the username & then I input it

Then this copies the files to the other server so it will;

Ask me the server name to & then I input it.
Ask me for the username & I input it

I have tried finding a newsgroup for DOS but I can't find it.
If you can help thanks in advance

James

Here is the general idea:

@echo off
set /p server1=Please enter the name of the source server:
xcopy /s /y /d /c \\%server1%\SomeShare\SomeFolder\*.* \\%Server2%\etc.
 
From: "James" <[email protected]>

| I want to create a batch file that copies files from one server to the other
| & should kind of do the following;
|
| Ask me for the server name & then I input it.
| Ask me for the username & then I input it
|
| Then this copies the files to the other server so it will;
|
| Ask me the server name to & then I input it.
| Ask me for the username & I input it
|
| I have tried finding a newsgroup for DOS but I can't find it.
| If you can help thanks in advance
|
| James


Forget the Command interpreter and all its limitations.
Think about a higher level interpreter such as the Kixtart interpreter (http://kixtart.org,
Kixtart is CareWare).

I also suggest a scripting News Group; microsoft.public.windows.server.scripting
 
Pegasus & David H. Lipman - Thankyou

Pegasus (MVP) said:
Here is the general idea:

@echo off
set /p server1=Please enter the name of the source server:
xcopy /s /y /d /c \\%server1%\SomeShare\SomeFolder\*.* \\%Server2%\etc.
 
Hi - the code is working fine however I have encountered a problem. I have
alot of servers & I (if possible) would like to be able to select server 1 as
the source but in another instance select say server 63 in another instance &
not have to change the batch file. Is that possible?
 
You have to be a little more specific. The sample code I gave
you will already prompt you for the server name. You could
therefore enter "Server1" the first time, then "Server63" the
next time. Now why is it that this does not meet your requirement?

It might also be a good idea to post your batch file in your
reply.
 
Back
Top