# Input\Output Batch File



## AndrewUsh (Jan 28, 2013)

Hi,

Just a quick question really. im trying to create a batch file where the input and output are combined in one file. Is this possible?

Thank you 

Andrew


----------



## Squashman (Apr 4, 2003)

An example of your input and what you want the output to look like would probably help.


----------



## foxidrive (Oct 20, 2012)

An answer in another forum:


```
@echo off
for /f "delims=" %%a in (file.txt) do (
>>file.txt echo output: %%a
)
```


----------



## shirulkar (Jan 24, 2013)

Following code will take input from same file and paste output in same file.

FOR /F "usebackq tokens=*" %%a in ("log.txt") do echo %%a >> "log.txt"


----------



## AndrewUsh (Jan 28, 2013)

Basically i'm trying to individually add a large amount of users to 64 servers.

so what i meant by input and ouput is that it shows you the command you running and the response it gives.

If someone already has access to a server it states dsadd failed: already a member.

Unfortunately some people used '0' instead of 'o' when inputting server names, so when i try to add them to that server i just get dsadd failed.

Because of the large amount of commands being used, i cant see which command has failed

Does that make sense?

Do the commands given above allow me to do that?


----------



## foxidrive (Oct 20, 2012)

You are running a batch file with the 'dsadd' tool in I presume.
As long as it doesn't require keyboard input launch it like this:


```
batch.bat >dsadd-log.txt
```
and then you can filter the log file with a command looking for errors and examine dsadd-error.txt


```
find "already a member" <dsadd-log.txt >dsadd-error.txt
```


----------



## AndrewUsh (Jan 28, 2013)

sorry im not using dsadd. Im using dsmod group -addmbr


----------



## foxidrive (Oct 20, 2012)

The same thing applies. I used dsadd as filenames because thats what was in your text.

The filenames aren't important.


----------

