MS-DOS

From vWiki
Jump to: navigation, search

Useful Scripts

Simple Pre-Change Config Report

@echo off
echo Generating config report

set LOG=PreSvrMigrationCfg.txt

for /f "tokens=* delims=" %%a in ('date /t') do set date=%%a
for /f "tokens=* delims=" %%a in ('time /t') do set time=%%a 

echo ***************************************************** >> %LOG%
echo Generated at %date%%time% >> %LOG%

echo IP Config...
echo. >> %LOG%
echo ############################### >> %LOG%
echo ######  I P C O N F I G  ###### >> %LOG%
echo ############################### >> %LOG%
ipconfig/all >> %LOG%

echo Route Print...
echo. >> %LOG%
echo #################################### >> %LOG%
echo ######  R O U T E  P R I N T  ###### >> %LOG%
echo #################################### >> %LOG%
route print echo >> %LOG%

echo Running Services...
echo.  >> %LOG%
echo ############################################## >> %LOG%
echo ######  R U N N I N G  S E R V I C E S  ###### >> %LOG%
echo ############################################## >> %LOG%
net start  >> %LOG%

echo Completed (%LOG%)...!
ping 127.0.0.1 >NUL

Pinger

This script allows you to launch multiple new instances of continuous pings

@echo Off

REM If there's a 2nd command line param (eg :START) go to it
If not "%2"=="" GoTo %2

:GETIP
set /P IP=Enter address to ping: 

echo Starting new window to ping %IP%
echo.

REM Start a new command shell with this script and command line args of %IP% :START 
start Cmd /C %0 %IP% :START
goto :GETIP

:START
title %1
@echo on
ping -t %1
@echo off
ping 127.0.0.1 > NUL
:END