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
We keep track of your subscriptions through your Facebook account. No additional registration required.
Nothing will be posted to Facebook without your explicit permission.