Windows batch script to read an .ini file

Here’s a command file (ini.cmd) you can use to extract the relevant values: @setlocal enableextensions enabledelayedexpansion @echo off set file=%~1 set area=[%~2] set key=%~3 set currarea= for /f “usebackq delims=” %%a in (“!file!”) do ( set ln=%%a if “x!ln:~0,1!”==”x[” ( set currarea=!ln! ) else ( for /f “tokens=1,2 delims==” %%b in (“!ln!”) do ( set … Read more

How to convert the value of %USERNAME% to lowercase within a Windows batch script?

Well, I was browsing for some syntax and stumbled upon this page. I know its old but I thought I’d take a break and give the brain a little kick. Here’s something a little shorter and manageable. This just “brute forces” all uppercase letters to lowercase letters without regards to whether the actual letter exists … Read more

Find files on Windows modified after a given date using the command line

The forfiles command works without resorting to PowerShell. The article is here: Find files based on modified time Microsoft Technet documentation: forfiles For the example above: forfiles /P <dir> /S /D +12/07/2013 /P The starting path to search /S Recurse into sub-directories /D Date to search, the “+” means “greater than” or “since”

tech