1.

Solve : complete beginner?

Answer»

hi, im a complete begginer with BATCH files, but what I have to is create a batch file that will

run a batch file (db.bat) on a remote computer
and then get a file (tuxp.txt) from a remote computer and put that file in a folder in E:\DB
and that file should overwrite any txt file in there aswell as moving  the overwritten file to a folder E:\DB\OLD.

all I know about batch files is that you create them with notepad.

Please help

thanks in advanceWhy do you need to do this? Is this a HOMEWORK question? I can't think of any other answer to ask this, but hold on and read these and the teacher will be along shortly.


http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html

http://www.allenware.com/icsw/icswidx.htm

http://www.techtutorials.info/dbatch.html

www.HomeworkHope.com Quote

all I know about batch files is that you create them with notepad.

You probably mean "I know nothing about DOS".

You see, normally you would start a DOS (CMD window) by Start/Run/CMD

There, you would issue DOS commands. For example, the AT command might help you run something on another computer.

To learn how a command works, enter the OPERAND "/?", for example
AT /?

Now MOVE will move a file, COPY will copy one.

So you just figure out how to solve your problem one DOS command at a time.

When you know what you want to do, you put the commands into a single file with SUFFIX "bat" and voila.

The only thing you might need to learn about BAT is that %1 means the first operand, etc. like this

The file is Z.BAT:
copy %1 d:\here\file1.dat
copy %2 d:\here\file2.dat

That is a nonsense two-line BAT file that will do this, if you enter
Z abc.txt def.txt

copy abc.txt d:\here\file1.dat
copy def.txt d:\here\file2.dat

So now you know about BAT files. Work on it and let us know if you have some specific question.

Mac




Discussion

No Comment Found