Thread: C / C++ & OS
View Single Post
  #3 (permalink)  
Old July 14th, 2007, 11:32 AM
TotcoS TotcoS is offline
Registered User
 
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to TotcoS Send a message via MSN to TotcoS Send a message via Yahoo to TotcoS
Default

Quote:
quote:Originally posted by manih
 Dear programmers.
I'm new in C / C++ programming and I want to write program which output the information of OS (Windows / Unix / Mac - Username - Domain name ...). Dose anyone knows how to do this?


Thanks
Best Regards
ManiH.

Code:
#include <iostream>
using namespace std;

int main(){
    cout << "WHOAMI: ";
    system("echo %USERNAME%");
    cout << "OS: ";
    system("echo %OS%");
    system("pause");
}
I don't need a signature =D
Reply With Quote