-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetOS.cpp
More file actions
31 lines (26 loc) · 740 Bytes
/
Copy pathgetOS.cpp
File metadata and controls
31 lines (26 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <string>
using namespace std;
int main() {
#if defined(_WIN32) || defined(_WIN64) || defined(__TOS_WIN__) || defined(OS_WINDOWS) || defined(__WIN32__) || defined(__WINDOWS__)
char windows = 'y'
cout<< " Windows"<< endl; system("dir");
#else
windows = 'n'
cout<<"NOT Windows"<< endl; system("ls");
#endif
system("systeminfo");
return 0;
}
//short getOS()
//{
// #if defined(_WIN32) || defined(_WIN64) || defined(__TOS_WIN__) || defined(OS_WINDOWS) || defined(__WIN32__) || defined(__WINDOWS__)
// char windows = 1;
// cout<< " Windows"<< endl; system("dir");
//
// #else
// windows = 0;
// cout<<"NOT Windows"<< endl;
// #endif
//
//}