Solved

Windows 7 Pro 32Bit and the append command

Posted on 2014-01-15
27
359 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 90

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
 

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 90

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 90

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 90

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 90

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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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 90

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now