Results 1 to 3 of 3

Thread: How to get system drive?

  1. #1
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default How to get system drive?

    Hi all,

    I have to parse the result of a DOS command, and I need that that DOS command is executed on the system drive.
    For example if the system drive is "C:\" it must be executed in "C:\" and not "D:\" or "X:\" or what else.
    So is there a way to get the system drive?

    By the way: if there is an easier way to get the system drive volume serial number, it would be great if he could tell it

    Thank you in advance!
    Last edited by Raccoon29; 21st November 2008 at 11:18.
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to get system drive?

    I think there is some environment variable on windows that keeps the system directory. You can extract the drive from there.

  3. The following user says thank you to wysota for this useful post:

    Raccoon29 (23rd November 2008)

  4. #3
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to get system drive?

    Quote Originally Posted by wysota View Post
    I think there is some environment variable on windows that keeps the system directory. You can extract the drive from there.
    In fact "windir" will do what I need, thanks again S.Wysota
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

Similar Threads

  1. "new QFileDialog" vs. "getSaveFileName" drive names
    By Rayven in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2008, 13:11
  2. Using QT for Digital TV menu system?
    By mittalpa in forum Newbie
    Replies: 4
    Last Post: 2nd July 2008, 19:23
  3. QFileDialog Crashes with Networked Drive
    By Rayven in forum Qt Programming
    Replies: 6
    Last Post: 20th February 2008, 02:01
  4. System environment variable
    By fahlen in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2007, 19:02
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.