wmic path fix - windows
This commit is contained in:
parent
980828f00e
commit
bd842b20a4
@ -30,6 +30,8 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 4.6.1 | 2019-05-29 | get wmic path - fic windows |
|
||||||
|
| 4.6.0 | 2019-05-27 | added `dockerInfo()` |
|
||||||
| 4.5.1 | 2019-05-17 | updated docs |
|
| 4.5.1 | 2019-05-17 | updated docs |
|
||||||
| 4.5.0 | 2019-05-17 | `fsOpenFiles()` added open file descriptor count |
|
| 4.5.0 | 2019-05-17 | `fsOpenFiles()` added open file descriptor count |
|
||||||
| 4.4.1 | 2019-05-11 | updated docs |
|
| 4.4.1 | 2019-05-11 | updated docs |
|
||||||
|
|||||||
@ -80,6 +80,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">4.6.1</th>
|
||||||
|
<td>2019-05-29</td>
|
||||||
|
<td><span class="code">wmic</span> path fix - windows</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">4.6.0</th>
|
<th scope="row">4.6.0</th>
|
||||||
<td>2019-05-27</td>
|
<td>2019-05-27</td>
|
||||||
|
|||||||
@ -170,7 +170,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.6.0</span></div>
|
<div class="version">Current Version: <span id="version">4.6.1</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">
|
||||||
|
|||||||
14
lib/util.js
14
lib/util.js
@ -221,12 +221,18 @@ 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';
|
||||||
|
if (!fs.existsSync(wmicPath)) {
|
||||||
try {
|
try {
|
||||||
wmicPath = execSync('WHERE WMIC').toString().trim();
|
const wmicPathArray = execSync('WHERE WMIC').toString().split('\r\n');
|
||||||
|
if (wmicPathArray && wmicPathArray.length) {
|
||||||
|
wmicPath = wmicPathArray[0];
|
||||||
|
} else {
|
||||||
|
wmicPath = 'wmic';
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (fs.existsSync(process.env.WINDIR + '\\system32\\wbem\\wmic.exe')) {
|
wmicPath = 'wmic';
|
||||||
wmic = process.env.WINDIR + '\\system32\\wbem\\wmic.exe';
|
}
|
||||||
} else wmicPath = 'wmic';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return wmicPath;
|
return wmicPath;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user