Hey!

Welcome to Blip, home of the best original web series! When you’re done watching this episode, checkout some of our top shows or learn more about us!

×

SchoolFreeware

Pascal Helper Series Video 4 - Running External Programs and Batch Scripts

Other Sharing Options

×
Embed
The embed code has been copied to your clipboard
Share
About this episode
This code can be downloaded for free at http://www.schoolfreeware.com Help request: I would like to know if there is any way i can execute a .bat fi...
This code can be downloaded for free at http://www.schoolfreeware.com Help request: I would like to know if there is any way i can execute a .bat file with my free pascal. (There was more to the message, but this was the main question) To execute an external program from within the pascal code is a simple process. TProccess will do it quickly. TProcess requires Process added to the uses area. This the setup: uses Process; var RunProgram: TProcess; begin RunProgram := TProcess.Create(nil); RunProgram.CommandLine := ‘Path and Name of Program’; RunProgram.Execute; RunProgram.Free; end; The batch .bat code used in the video tutorial: @Echo Hello This Is The Batch File" @pause notepad.exe @Time @pause Links of Interest: Lazarus (Free Pascal) Wiki article on executing external programs. http://wiki.lazarus.freepascal.org/Executing_External_Programs TProcess Code: http://lazarus-ccr.sourceforge.net/docs/fcl/process/tprocess.html TProcess Help For Mac: http://www.mail-archive.com/lazarus@lazarus.freepascal.org/msg01971.html TProcess Help For Linux: http://www.mail-archive.com/lazarus@miraclec.com/msg20819.html Less
05:40 How To
Discover the best in original web series.© 2012 Blip Networks, Inc. All Rights Reserved.