Skip to content

Instantly share code, notes, and snippets.

@RickCogley
Created November 25, 2014 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RickCogley/cf819594a09e9141a6a8 to your computer and use it in GitHub Desktop.
Save RickCogley/cf819594a09e9141a6a8 to your computer and use it in GitHub Desktop.
Batch file sample to show how to create a file for capturing output, then append to that file.
@echo off
# Author: Rick Cogley
# Last Update: 1 Nov 2014
echo "== STARTING BATCH =="
echo "Results from %computername%:" > results.txt
echo "Pinging..." >> results.txt
ping www.esolia.com >> results.txt
echo. >> results.txt
echo "Running SET..." >> results.txt
set >> results.txt
echo. >> results.txt
echo "PC info..." >> results.txt
echo "Computer: %computername%" >> results.txt
echo "Domain: %computerdomain%" >> results.txt
echo "== ENDING BATCH =="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment