I have batch file in which i am restarting a machine and want to check if machine is back online then execute the code block else after particular time inform the user the machine is not online I want to check something like:
pingresult = ping \\machinename
if (pingresult == true)
{
execute some task
}
else
{
keep pinging for say 5min. if after 5mins machine is not up show message to user
}