wmic added default windows path (windows)
This commit is contained in:
parent
5093145506
commit
c6fccc0513
@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 4.30.6 | 2020-11-27 | wmic added default windows path (windows) |
|
||||||
| 4.30.5 | 2020-11-26 | adapted security update (prototype pollution prevention) |
|
| 4.30.5 | 2020-11-26 | adapted security update (prototype pollution prevention) |
|
||||||
| 4.30.4 | 2020-11-25 | reverted Object.freeze because it broke some projects |
|
| 4.30.4 | 2020-11-25 | reverted Object.freeze because it broke some projects |
|
||||||
| 4.30.3 | 2020-11-25 | security update (prototype pollution prevention) Object.freeze |
|
| 4.30.3 | 2020-11-25 | security update (prototype pollution prevention) Object.freeze |
|
||||||
|
|||||||
@ -83,6 +83,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">4.30.6</th>
|
||||||
|
<td>2020-11-27</td>
|
||||||
|
<td><span class="code">wmic</span> added default windows path</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">4.30.5</th>
|
<th scope="row">4.30.5</th>
|
||||||
<td>2020-11-26</td>
|
<td>2020-11-26</td>
|
||||||
|
|||||||
@ -168,7 +168,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span></div>
|
<div class="subtitle"><span id="typed"></span></div>
|
||||||
<div class="version">Current Version: <span id="version">4.30.5</span></div>
|
<div class="version">Current Version: <span id="version">4.30.6</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
|
|||||||
@ -33,6 +33,8 @@ let _cores = 0;
|
|||||||
let wmicPath = '';
|
let wmicPath = '';
|
||||||
let codepage = '';
|
let codepage = '';
|
||||||
|
|
||||||
|
const WINDIR = process.env.WINDIR || 'C:\\Windows';
|
||||||
|
|
||||||
const execOptsWin = {
|
const execOptsWin = {
|
||||||
windowsHide: true,
|
windowsHide: true,
|
||||||
maxBuffer: 1024 * 20000,
|
maxBuffer: 1024 * 20000,
|
||||||
@ -295,7 +297,7 @@ function findObjectByKey(array, key, value) {
|
|||||||
|
|
||||||
function getWmic() {
|
function getWmic() {
|
||||||
if (os.type() === 'Windows_NT' && !wmicPath) {
|
if (os.type() === 'Windows_NT' && !wmicPath) {
|
||||||
wmicPath = process.env.WINDIR + '\\system32\\wbem\\wmic.exe';
|
wmicPath = WINDIR + '\\system32\\wbem\\wmic.exe';
|
||||||
if (!fs.existsSync(wmicPath)) {
|
if (!fs.existsSync(wmicPath)) {
|
||||||
try {
|
try {
|
||||||
const wmicPathArray = execSync('WHERE WMIC').toString().split('\r\n');
|
const wmicPathArray = execSync('WHERE WMIC').toString().split('\r\n');
|
||||||
@ -317,7 +319,7 @@ function wmic(command, options) {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
try {
|
try {
|
||||||
exec(process.env.WINDIR + '\\system32\\chcp.com 65001 | ' + getWmic() + ' ' + command, options, function (error, stdout) {
|
exec(WINDIR + '\\system32\\chcp.com 65001 | ' + getWmic() + ' ' + command, options, function (error, stdout) {
|
||||||
resolve(stdout, error);
|
resolve(stdout, error);
|
||||||
}).stdin.end();
|
}).stdin.end();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user