Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8440189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:13:12+00:00 2026-06-10T08:13:12+00:00

Hi I was trying to find the DVD drive on computer with the script

  • 0

Hi I was trying to find the DVD drive on computer with the script below. GetDriveType always returning 1, Even I pass the drive letter manually it still returns 1, can any tell me why it is doing like that, I am completely new to nsis script

System::Call 'kernel32::GetLogicalDrives()i.r0'
StrCpy $1 $windir 3 ; Fallback if things go wrong
StrCpy $2 0
StrCpy $4 65 ; 'A'
loop:
    IntOp $3 $0 & 1
    ${If} $3 <> 0
        IntFmt $3 "%c:\" $4
        MessageBox MB_OK "Drive : $3"
        System::Call 'kernel32::GetDriveType(t,.r3)i.r5'
        MessageBox MB_OK "Value of 5555555: $5"
        StrCmp $5 5 0 NoDrive
            MessageBox MB_OK "Found drive $3"
            StrCpy $1 $3
        Nodrive:
            ;do nothing
    ${EndIf}
    IntOp $4 $4 + 1
    IntOp $0 $0 >> 1
StrCmp $0 0 "" loop
System::Call 'kernel32::GetDriveType(t,"D:\")i.r5'
StrCmp $5 5 0 NoDr
    MessageBox MB_OK "Found D as $D"
NoDr:
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:13:14+00:00Added an answer on June 10, 2026 at 8:13 am

    The correct syntax is System::Call 'kernel32::GetDriveType(tr#)i.r#' (Comma is parameter separator and . means no input and you have input in this case):

    !include LogicLib.nsh
    System::Call 'kernel32::GetLogicalDrives()i.r0'
    StrCpy $2 0
    StrCpy $4 65 ; 'A'
    loop:
        IntOp $3 $0 & 1
        ${If} $3 <> 0
            IntFmt $3 "%c:\" $4
            System::Call 'kernel32::GetDriveType(tr3)i.r5'
            DetailPrint "$3=$5"
        ${EndIf}
        IntOp $4 $4 + 1
        IntOp $0 $0 >> 1
    StrCmp $0 0 "" loop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to find every drive letter that isnt C,E,L,S,T,W on a windows 2008
I am trying find a string in below string. http://example.com/TIGS/SIM/Lists/Team Discussion/DispForm.aspx?ID=1779 by using http://example.com/TIGS/SIM/Lists
Trying to find a standard. The CmdLet will process data - multiple input, defined
Trying to find a way to remove blank pages from a document I wrote
Trying to find out if it's possible to use SQLAlchemy on Heroku. Thanks.
Trying to find the best way of create an overlap/overlay layer to fill the
Trying to find a good name for a method swapping each coordinate X and
Trying to find an example that has css rollover using sprites & sliding door
Trying to find a way to send a POST HTTPS request from Python to
Trying to find examples of when decorators might be really beneficial, and when not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.