Skip to content

Retrieving Windows HDD info with node-disk-info creates command popup. #9

@jbrink90

Description

@jbrink90

I've noticed when running the server (api.js) on Windows and calling the method to update the HDDs creates a momentary popup from a command prompt window.

node-disk-info leverages execSync to run commands. I'll need to look into windowsHide;

src/platforms/windows.ts

let buffer = Utils.execute(Constants.WINDOWS_COMMAND);

src/utils/constants.ts

public static readonly WINDOWS_COMMAND: string = 'wmic logicaldisk get Caption,FreeSpace,Size,VolumeSerialNumber,Description  /format:list';

src/utils/utils.ts

public static execute(command: string): Buffer {
    return execSync(command,{windowsHide: true, encoding: 'buffer'});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions