How can I run command in cmd as administrator using c++? I have virus on my notebook that changes DNS address every 20-30 minutes. I want to create program to change DNS address by myself.

#include<iostream> #include<windows.h> using namespace std; main() { system("netsh interface ip set dns “Ethernet” static 192.168.0.1"); return 0; }

I need to run this command as admin. Please help.