• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

determine Windows drive letters and labels

Engaged ,
Apr 22, 2017 Apr 22, 2017

Copy link to clipboard

Copied

Hi everyone,

currently I'm a bit stuck trying to find a clean and efficient way to determine and re-map a Windows drive letter to a Mac OS path, e.g.

"file://localhost/D:/Media/Card01/Clip01.mov" should end up as "file://localhost/Volumes/VideoDrive/Media/Card01/Clip01.mov" (if VideoDrive is the D: volume name).

I tried wmic which fails because it seems that I can only pass 2 arguments to window.cep.createProcess() where in this case I would need 4 (cmd line is "wmic logicalvolume get caption,volumename") --- which is a bit strange b/c the createProcess header does not suggest the argument count was limited to 2, but maybe the implementation is (?). (Of course I could use less parameters for wmic, but then I'd have to do a lot of filtering to get what I need. Not an option.)

The other approach was to use create.process.stdin(pID,'vol\ D:') after creating a cmd.exe process, but there I wasn't able to catch the respective stdout (only returns the initial cmd stdout).

Any ideas? Hint: I need to solve this without using node.js or other "3rd party" framworks.

Cheers.

TOPICS
SDK

Views

337

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 09, 2017 May 09, 2017

Copy link to clipboard

Copied

LATEST

For now I've solved this using the not-an-option option: wmic with only two parameters, parsing the result down to a map. About 25 lines of code, so it's not as bad as expected.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines