Windows 7 Pro 32Bit and the append command

Hello All,


I'm a truly wet behind the ears when it comes to .bat files. We had a very old Win2000 PC that we replaced with a Win 7 Pro box. It was running a .bat file which no longer works on the new Win 7 Pro PC. The .bat file is below:


ECHO OFF


APPEND c:\qualedi\qe810 i: /d


APPEND c:\qualedi\qe850 i: /d


I put a pause at the end of the command to see if there were any errors and the error states that there are "too many parameters".


The creator of the bat file said the purpose of the file was to take file and move it to the i: drive and get rid of the original one.


Anyone have any ideas on an alternative? It's Win 7 Pro 32bit by the way.


Thanks in advance,


Alex
jambearAsked:
Who is Participating?
 
strivoliConnect With a Mentor Commented:
Well, you have 2 APPEND commands and I have only 1 TYPE command.

These are the 2 commands:

type c:\qualedi\qe810 >> i:qe810
type c:\qualedi\qe850 >> i:qe850


Give it a try and you'll see the result yourself. Please let me know.
Ciao.
0
 
strivoliCommented:
The APPEND command might have changed. Run "APPEND /?" in order to discover the syntax.
0
 
JohnBusiness Consultant (Owner)Commented:
The append command is an old DOS command. It is not available in 64-bit because DOS cannot run in 64-bit. You say you have 32-bit, but the command shell is not real DOS, so the append command may not work.

What you are trying to do is MOVE a file, so try using the MOVE command instead. That will work in the command shell and so will work going forward (Windows 7, Windows 8 64-it machines).

.... Thinkpads_User
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
JullezNetwork EngineerCommented:
If the purpose was to move the file from one location to another then delete the original you can try this:



@ECHO OFF

robocopy /MOV  c:\qualedi\qe810 i:

robocopy /MOV  c:\qualedi\qe850 i:



Tested on Win7 Pro 32bit - it worked.


robocopy /?

/MOV :: MOVe files (delete from source after copying).
0
 
jambearAuthor Commented:
****** DISREGARD****

did not see the rest of your post.

Thanks for the responses. So this will work?

ECHO OFF

MOVE c:\qualedi\qe810 i: /d

MOVE c:\qualedi\qe850 i: /d
0
 
JullezNetwork EngineerCommented:
MOVE will not work on Win 7 if you want to move the files in that directory - tested it.

MOVE C:\crash\ G:\test
The system cannot find the file specified.

MOVE C:\crash\*.* G:\test
The filename, directory name, or volume label syntax is incorrect.
0
 
JohnBusiness Consultant (Owner)Commented:
You do not need the /d parameter with MOVE,  so MOVE c:\qualedi\qe850 i:  should work.

You can get the MOVE syntax with MOVE /?  

... Thinkpads_User
0
 
jambearAuthor Commented:
thanks for the suggestions. if the file already exists, we would like it to add to the file instead of deleting it. that's where the old append command came in handy. hope that makes sense.
0
 
JohnBusiness Consultant (Owner)Commented:
The Syntax for move is:

MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

If destination is just drive letter, it should work.

... Thinkpads_User
0
 
strivoliCommented:
A simple "TYPE new_file >> old_file" command will append new_file contents to the old_file contents. That makes sense with TXT files.
0
 
JohnBusiness Consultant (Owner)Commented:
You can use COPY to copy multiple source files into a destination file. Then MOVE it.

You could also COPY multiple source files into the desired destination. Then you would have to DEL multiple sources files.

Either way, it is two commands in a batch file.

... Thinkpads_User
0
 
jambearAuthor Commented:
thinkpads_user - if they file already exists, will your suggestion below delete the file or append to it?

MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
0
 
jambearAuthor Commented:
strivoli - what would my command look like using your suggestion? thanks in advance.
0
 
JohnBusiness Consultant (Owner)Commented:
The MOVE command above will move multiple files to a destination and delete them from the source. But MOVE does not combine files. You need COPY to do that and hence the two commands in your batch file as I suggested.

If the files do not exist, MOVE will give an error.

... Thinkpads_User
0
 
jambearAuthor Commented:
thinkpads_user - thanks for your suggestion. what would my command look like using your suggestions above?
0
 
strivoliCommented:
"type c:\qualedi\qe810 >> i:qe810" provided the qe810 is a file and not a directory.
0
 
JohnBusiness Consultant (Owner)Commented:
To combine files and move:

COPY file1 file2 file3 file4 I:\filenew
DEL file1 file2 file3 file4

.... Thinkpads_User
0
 
JullezNetwork EngineerCommented:
robocopy /MOV will solve your issue strivoli - tested.
0
 
strivoliCommented:
@Jullez

Thank you, but... what I understand is that the requester wants to append a file to an existing file. You suggestion moves one file from source to destination.
These are 2 different things.
Please correct me if I'm wrong.
0
 
jambearAuthor Commented:
strivoli - you are correct. I definitely want to append a file to an existing file.
0
 
JullezNetwork EngineerCommented:
You said: "The creator of the bat file said the purpose of the file was to take file and move it to the i: drive and get rid of the original one."

You are adding files to the directory not the contents of the file to another file.
0
 
jambearAuthor Commented:
Jullez - I edited it and added a comment that want to append a file to an existing file.
0
 
JullezNetwork EngineerCommented:
Yes, I see it now.
0
 
jambearAuthor Commented:
sorry for the confusion.
0
 
jambearAuthor Commented:
strivoli - just to be clear

ECHO OFF
type c:\qualedi\qe810 >> i:qe810


will do the same as our old command below? you are correct. qe810 is a file not a directory.

ECHO OFF
APPEND c:\Qualedi\qe810 i: /d
APPEND c:\Qualedi\qe850 i: /d


thanks again for your suggestion
0
 
jambearAuthor Commented:
strivoli - thanks a million! it worked!
0
 
strivoliCommented:
Glad it worked! You're welcome. Have a nice day!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.