Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva
 

Here a collection of dos script. Just my notes shared with you.

 

 

SHOW PATH VARIABLE FORMATTED

It replace the semicolon with ECHO

@echo off
REM Simple way to show path formatted, replacing ; with echo
ECHO %PATH:;= & ECHO.%

 

 

 

 

 GET CURRENT BATCH INFO

@echo off
REM filename :  c:\temp\test.cmd
echo %0
echo %~d0
echo %~dp0
echo %~nx0


IT WILL OUTPUT
=================
C:\>
C:\>c:\temp\test.cmd
c:\temp\test.cmd
c:\temp\
c:
test.cmd
C:\>



 

 

Execute a type of all text files specified and create a new file.

This is just an example for "forfile" command. Type *.txt will performe a type of all txt files.

REM all.txt will contain all contents of files eml
forfiles /m *.eml /C "CMD /c type @file >> all.txt"

 

 

DISQUS - Leave your comments here