C-language ,is it Possible?

I have written one program in ‘C’
#include<windows.h>
#include<stdio.h>
#include<stdlib.h>
main()
{
system(“dir”);
}

Program name is hello.c and i compiled it to generate hello.exe
Now i want use this hello.exe as nagios exernal script to see the result of this executable from remote machine
I just want to know is it possible