Call for DOS commands in Delphi

zhaozj2021-02-16  84

Procedure TForm1.sendmmsg (Messagestr: String); // Used to send message VAR Si: TStartupinfo; PI: TProcessInformation; Begin MessageStr: = 'Net Send Hostname' MessageStr;

if sendcount = -1 then begin FillChar (si, SizeOf (StartUpInfo), $ 00); si.dwFlags: = STARTF_USESHOWWINDOW; si.wShowWindow: = SW_Hide; if CreateProcess (nil, PChar (MessageStr), nil, nil, False, IDLE_PRIORITY_CLASS , NIL, NIL, SI, PI) THEN BEGIN CloseHandle (PI.hthread); CloseHandle (PI.hprocess); Else ShowMessage ('sss'); Else While Not (Teedit3.Text = '0') Do Begin Fillchar (si, SizeOf (StartUpInfo), $ 00); si.dwFlags: = STARTF_USESHOWWINDOW; si.wShowWindow: = SW_Hide; if CreateProcess (nil, PChar (BatchFileName), nil, nil, False, IDLE_PRIORITY_CLASS, nil, nil, si, pi .................................................................... .. END;

转载请注明原文地址:https://www.9cbs.com/read-13381.html

New Post(0)