1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Input\Output Batch File

Discussion in 'DOS/Other' started by AndrewUsh, Jan 28, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. AndrewUsh

    AndrewUsh Thread Starter

    Joined:
    Jan 28, 2013
    Messages:
    3
    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
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    An example of your input and what you want the output to look like would probably help.
     
  3. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    An answer in another forum:

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

    shirulkar

    Joined:
    Jan 24, 2013
    Messages:
    5
    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"
     
  5. AndrewUsh

    AndrewUsh Thread Starter

    Joined:
    Jan 28, 2013
    Messages:
    3
    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?
     
  6. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    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:

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

    Code:
    find "already a member" <dsadd-log.txt >dsadd-error.txt
     
  7. AndrewUsh

    AndrewUsh Thread Starter

    Joined:
    Jan 28, 2013
    Messages:
    3
    sorry im not using dsadd. Im using dsmod group -addmbr
     
  8. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    The same thing applies. I used dsadd as filenames because thats what was in your text.

    The filenames aren't important.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1087258

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice