top of page

Winbatch


I've posted quite few batch commands to this site in the past, including the very first Tip of the Night on April 10, 2015, which showed how to use the DOS batch command dir to get a list of files in a folder.

WinBatch is a scripting language that uses DOS batch commands with the Basic and C scripting languages. There is a WinBatch tech database in which you can find scripts to accomplish a variety of common tasks, and a trial version of WinBatch Navigator can be downloaded for free here, http://www.winbatch.com/download.html .

So if you open WinBatch Navigator and click on the WinBatch Studio utility, a script editor will open. You can copy scripts from the tech database, enter them in the editor and then save them as files with a .wbt extension.

A script such as this one:

;Count lines in a file - one way anyway fn="C:\test\filename.txt" count=0 handle=FileOpen(fn,"READ") While @TRUE line=FileRead(handle) If line=="*EOF*" Break Else count=count+1 EndIf EndWhile FileClose(handle) Message("Lines in the file",count)

. . . will count the number of lines in text file listed on the second line.

So for this text file:

. . . we get this result:


Recent Posts

See All
backup mode for robocopy

When using robocopy command in Windows to copy files, note that if you are an admin you can use the /B switch to copy files from...

 
 

Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

​

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

​

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page