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;