pass parameters between Delphi app and batch file


Posted by Stefan Loeners on April 29, 2000 at 20:38:10:

How to pass parameters from an application to a batch file?
This DLL (taken from the demos) keeps track of all folder operations : deletions, moves, copies, renames, puts the result in a log file and sends a Novell Netware broadcast message to a recipient specified in a batch file.
Here is the last part :
// write data to file and close
Writeln(F, DateToStr(Date) + '-'+ TimeToStr(Time)+ ' - ' + Operation + ' Folder ' +PszSrcFile + ' ' + Rslt);
......
// launch c:\copyhook.bat: sends broadcast message ShellExecute(0, 'open', PChar('c:\copyhook.bat'), nil, nil, SW_HIDE);

I would like to pass the following parameters to the batch file : PszSrcFile (the folder on which the operation was performed), Operation (delete, move, rename or copy), Rslt (confirmed or attempted, depending on the choice made by user)
The code of the batch file copyhook.bat looks like this :
send "... attempted an illegal folder operation" MY_SERVER/MY_ID /B


Related Articles and Replies: