Blog Archives

How to loop through files in a folder using MS DOS batch file or Commandline

PowerShell rocks but I still use DOS commands to automate many day to day tasks Here is a script which can loop through files and perform whatever actions you want As you can see that %%F will return full path

Tagged with: ,
Posted in Tips

How to search string in DOS Batch file from commandline using findstr

Windows-Logo

This post shows how to find string in a file from MS DOS commandline ::findstr with /C: switch will search entire file for exact string findstr /M /C:"search-string-xyz" "C:\Files\MyLog.txt" > log_search_status.txt if %errorlevel%==0 ( echo SUCCESS – STRING FOUND )

Tagged with: ,
Posted in Tips

How to compile Visual Studio Solution from commandline and check status in DOS BAT file

If you ever tried to automate your build process from commandline then here is easy way to compile your solution @echo off SET PROGRAM_32BIT=%ProgramFiles% if not "%ProgramFiles(x86)%" == "" set PROGRAM_32BIT=%ProgramFiles(x86)% ::TODO: I have this sample for VS2010 but change it

Tagged with: , ,
Posted in .net