Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 27th, 2007, 07:29 PM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default C / C++ & OS

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.

Reply With Quote
  #2 (permalink)  
Old June 29th, 2007, 07:23 AM
Registered User
 
Join Date: Jun 2007
Location: Oklahoma City, Oklahoma, USA.
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

The only thing I can think of is using system().

Code:
#include <iostream>
using namespace std;

int main() {
    system("set");
    cout << endl;
    cin.get();
    return(0);
}
I don't need a signature =D
Reply With Quote
  #3 (permalink)  
Old July 14th, 2007, 11:32 AM
Registered User
 
Join Date: Jun 2007
Location: Oklahoma City, Oklahoma, USA.
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
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript & Safari (On MAC OS) usman_iftikhar Javascript 2 October 1st, 2006 11:01 PM
Javascript && keeps turnig into &amp;&amp; ayrton Pro VB.NET 2002/2003 3 June 27th, 2005 03:34 PM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM
OS chaos2003 Linux 1 August 26th, 2003 12:12 PM
JRun4 for Mac OS + Mac OS X's Java 1.4.1 elbicho J2EE 0 June 27th, 2003 12:18 PM



All times are GMT -4. The time now is 11:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.