The program psexec runs any command remotely on another computer. the syntax is "psexec \\RemoteComputer cmd.exe"
I want to run "start "www.website.com" on computers a19-(01-29)
any help would be appreciated
#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(int argc, char *argv[])
{
int compNum;
compNum=0;
std::string zero="0";
std::string foo,s1,s,s2,s3,s6,s7,s8,s10;
std::string command;
////////////////////////////////////////////////////////////////////////
for (compNum; compNum < 10;compNum++)
{
std::string compNum2;
std::stringstream out;
out << compNum;
compNum2 = out.str();
//*
s1="psexec ";
s2= "\\";
s3="a19-";
s6=" cmd.exe";
s7=" '";
s8= "start";
command = " www.google.com";
s10="'";
foo = s1 + s2 += s2;
foo += s3 += zero;
foo += compNum2+= s6 += s7 += s8 += command;
foo += s10;
cout << foo;
cout << "\n";
}
///////////////////////////////////////////////////////////////////
for (compNum; compNum < 30;compNum++)
{
std::string compNum2;
std::stringstream out;
out << compNum;
compNum2 = out.str();
s1="psexec ";
s2= "\\";
s3="a19-";
s6=" cmd.exe";
s7=" '";
s8= "start";
command = " www.google.com";
s10="'";
foo = s1 + s2 += s2;
foo += s3;
foo += compNum2+= s6 += s7 += s8 += command;
foo += s10;
cout << foo;
cout << "\n";
system(foo);
}
system("PAUSE");
return EXIT_SUCCESS;
}