# DOS Append Command



## rogue085 (Apr 15, 2011)

I have been recently studying DOS for a few months and I seem dont get the Append command. I tried using Append with MS-DOS it works fine. But when I used it with windows xp it doesnt work. For example, The folder i am to use is at C:\data, inside the data folder is the data.txt. The problem is everytime i use "type data.txt" it leaves an error saying that file is not found. I dont know why is keeps saying that error.


----------



## DomCru (Feb 9, 2011)

The Append command should not be used in a Windows environment so that is likely the problem.
The type command works fine as long as the file you are referencing is in the same folder you are currently in. I.e. in the above example you do *CD \Data*, then *type data.txt*. If you still get the error saying file is not found, run the *dir* command to ensure the data.txt is there.


----------



## Couriant (Mar 26, 2002)

You are using the wrong command I think.

TYPE command will read the file and display it on screen. If the file is not there then it will give th"The system cannot find the file specified." error.

EDIT command will allow you to edit the file, providing it's available. If it's not, then it will treat it as a new file and will not save it until you do.

There is an APPEND command but not what you think (i think ). The append command is *>>*. For example, if I do a ping test and then want to add another test to the same file, I would do:

*ping yahoo.com > ping.txt
ping google.com >> ping.txt*

The first line creates the ping.txt file, the second one appends (adds) to the file. Is that what you mean?


----------



## rogue085 (Apr 15, 2011)

@Couriant that's not what i meant.. i mean the APPEND Command literally...
@DomCru that's what i have been guessing the problem, i have read few books that it should not be run on windows environment... but one thing that still does not clarify me is that, if it should not be run on windows environment then why is the append command still available? And maybe, is there any other way to bypass that? or what i mean is to run command in other ways...


----------



## Couriant (Mar 26, 2002)

Windows XP command line is not the same as DOS, but has commands that DOS has. If you do the command HELP in the command line window, you will see APPEND is not a valid command.

You could use DOSBOX instead, though I don't know if APPEND would be a valid command... i will look into that when I get home.


----------



## Squashman (Apr 4, 2003)

```
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

H:\>append /?
Cannot load VDM IPX/SPX support
Allows programs to open data files in specified directories as if they were in
the current directory.

APPEND [[drive:]path[;...]] [/X[:ON | :OFF]] [/PATH:ON | /PATH:OFF] [/E]
APPEND ;

  [drive:]path Specifies a drive and directory to append.
  /X:ON        Applies appended directories to file searches and
               application execution.
  /X:OFF       Applies appended directories only to requests to open files.
               /X:OFF is the default setting.
  /PATH:ON     Applies appended directories to file requests that already
               specify a path.  /PATH:ON is the default setting.
  /PATH:OFF    Turns off the effect of /PATH:ON.
  /E           Stores a copy of the appended directory list in an environment
               variable named APPEND.  /E may be used only the first time
               you use APPEND after starting your system.

Type APPEND ; to clear the appended directory list.
Type APPEND without parameters to display the appended directory list.
```


----------



## Couriant (Mar 26, 2002)

I stand corrected. I aplogise. I checked the list of commands and it was not there... so it must be a secret command....


----------



## Squashman (Apr 4, 2003)

IPCONFIG & the NET commands are on the cmd shell help either but we know they are there. They are just separate cmd line programs. All the commands you see when you type help are the built in commands of the cmd processor.


----------

