Forum Discussion
jackson_1
15 years agoFrequent Contributor
there is a change in windows 7 OS.
function ResolveIP(ComputerName): string;
var
objShell,objExec,RegEx;
var
StrOutput: string;
begin
objShell: = Sys.OleObject['WScript.Shell'];
objExec: = objShell.Exec('Ping ' + ComputerName + ' -4');
StrOutput: = objExec.StdOut.ReadAll;
RegEx: = HISUtils.RegExpr;
RegEx.Expression: = '(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})';
Regex.Exec(StrOutput);
if RegEx.MatchPos[0] then
result: = RegEx.Substitute('$&')
else
result: = 'IP Address colud not be resolved.!';
end;