Solved

Windows 7 Pro 32Bit and the append command

Posted on 2014-01-15
27
365 Views
Last Modified: 2014-01-16
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
0
Comment
Question by:jambear
  • 10
  • 6
  • 6
  • +1
27 Comments
 
LVL 19

Expert Comment

by:strivoli
ID: 39782126
The APPEND command might have changed. Run "APPEND /?" in order to discover the syntax.
0
 
LVL 94

Expert Comment

by:John Hurst
ID: 39782145
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
 
LVL 5

Expert Comment

by:Jullez
ID: 39782186
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jambear
ID: 39782189
****** 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
 
LVL 5

Expert Comment

by:Jullez
ID: 39782198
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
 
LVL 94

Expert Comment

by:John Hurst
ID: 39782202
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
 

Author Comment

by:jambear
ID: 39782209
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
 
LVL 94

Expert Comment

by:John Hurst
ID: 39782210
The Syntax for move is:

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

If destination is just drive letter, it should work.

... Thinkpads_User
0
 
LVL 19

Expert Comment

by:strivoli
ID: 39782219
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
 
LVL 94

Expert Comment

by:John Hurst
ID: 39782223
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
 

Author Comment

by:jambear
ID: 39782247
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
 

Author Comment

by:jambear
ID: 39782253
strivoli - what would my command look like using your suggestion? thanks in advance.
0
 
LVL 94

Expert Comment

by:John Hurst
ID: 39782258
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
 

Author Comment

by:jambear
ID: 39782283
thinkpads_user - thanks for your suggestion. what would my command look like using your suggestions above?
0
 
LVL 19

Expert Comment

by:strivoli
ID: 39782286
"type c:\qualedi\qe810 >> i:qe810" provided the qe810 is a file and not a directory.
0
 
LVL 94

Expert Comment

by:John Hurst
ID: 39782291
To combine files and move:

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

.... Thinkpads_User
0
 
LVL 5

Expert Comment

by:Jullez
ID: 39782297
robocopy /MOV will solve your issue strivoli - tested.
0
 
LVL 19

Expert Comment

by:strivoli
ID: 39782314
@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
 

Author Comment

by:jambear
ID: 39782332
strivoli - you are correct. I definitely want to append a file to an existing file.
0
 
LVL 5

Expert Comment

by:Jullez
ID: 39782338
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
 

Author Comment

by:jambear
ID: 39782347
Jullez - I edited it and added a comment that want to append a file to an existing file.
0
 
LVL 5

Expert Comment

by:Jullez
ID: 39782356
Yes, I see it now.
0
 

Author Comment

by:jambear
ID: 39782362
sorry for the confusion.
0
 

Author Comment

by:jambear
ID: 39782533
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
 
LVL 19

Accepted Solution

by:
strivoli earned 500 total points
ID: 39785010
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
 

Author Comment

by:jambear
ID: 39785238
strivoli - thanks a million! it worked!
0
 
LVL 19

Expert Comment

by:strivoli
ID: 39785341
Glad it worked! You're welcome. Have a nice day!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

by Nathan Brom/Bromy2004 Introduction There are numerous websites out there for any different type of program you can imagine.  Of those, you'll need to decide which ones are legitimate and aren't trying to steal your money or infect your comput…
This article describes how to set permissions to allow a limited-permissions user to start and stop a particular System Service.   It is always best to give users only the permissions that they need to perform their job, so tweaking particular permi…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question