ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Map Drive Script - Check for Drive letter in use

    IT Discussion
    drive mapping batch script scripting
    9
    23
    4.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • momurdaM
      momurda @gjacobse
      last edited by

      @gjacobse
      Yea you could just unplug the usb header on the mobo.

      DashrenderD 1 Reply Last reply Reply Quote 0
      • DashrenderD
        Dashrender @momurda
        last edited by

        @momurda said in Map Drive Script - Check for Drive letter in use:

        @gjacobse
        Yea you could just unplug the usb header on the mobo.

        This or find the powershell script and object names that allow you to find remove the drive letter mapping.

        1 Reply Last reply Reply Quote 0
        • DashrenderD
          Dashrender
          last edited by

          All of this seems like a lot of hard word versus (with management approval) an email stating -

          Starting tomorrow, what used to be the F: drive will now be mapped as the P: drive and what was the H: will now be the R: drive.
          Please be aware that any scripts currently using the F: or H: mappings will need to be updated to the new location. Instead of using P: or R:, please use \servername\sharename1 for P: and \servername2\sharename2 for R: This will prevent you from having to update these scripts in the future in the event that these drive letters will need to change.

          -IT.

          DustinB3403D 1 Reply Last reply Reply Quote 1
          • DustinB3403D
            DustinB3403 @Dashrender
            last edited by

            @Dashrender I agree, yet still don't understand the reason for using drive letters in the local drive space that is normally accessed by windows when connecting local storage.

            Start from Z and go backwards for any shares.

            DashrenderD 1 Reply Last reply Reply Quote 0
            • thwrT
              thwr @Danp
              last edited by

              @Danp said in Map Drive Script - Check for Drive letter in use:

              http://stackoverflow.com/questions/27246899/batch-check-if-mapped-network-drive-exists

              Seems to work too:
              http://stackoverflow.com/questions/24060404/check-if-drive-letter-exists-in-batch-or-else-goto-another-piece-of-code

              1 Reply Last reply Reply Quote 0
              • DashrenderD
                Dashrender @DustinB3403
                last edited by

                @DustinB3403 said in Map Drive Script - Check for Drive letter in use:

                @Dashrender I agree, yet still don't understand the reason for using drive letters in the local drive space that is normally accessed by windows when connecting local storage.

                Start from Z and go backwards for any shares.

                It's not greenfield, I'm sure Gene is working from a setup someone else built 15+ years ago before PCs came with all those stupid memory card slots that suck up a letter but don't map into explorer like he mentions.

                coliverC 1 Reply Last reply Reply Quote 1
                • coliverC
                  coliver @Dashrender
                  last edited by

                  @Dashrender said in Map Drive Script - Check for Drive letter in use:

                  @DustinB3403 said in Map Drive Script - Check for Drive letter in use:

                  @Dashrender I agree, yet still don't understand the reason for using drive letters in the local drive space that is normally accessed by windows when connecting local storage.

                  Start from Z and go backwards for any shares.

                  It's not greenfield, I'm sure Gene is working from a setup someone else built 15+ years ago before PCs came with all those stupid memory card slots that suck up a letter but don't map into explorer like he mentions.

                  I'm sure it was setup longer then 15 years ago sadly.

                  1 Reply Last reply Reply Quote 0
                  • DanpD
                    Danp
                    last edited by

                    How about this to get all drive letters in use?

                    for %i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @%i: 2>nul && set/pz=%i <nul

                    source

                    1 Reply Last reply Reply Quote 0
                    • J
                      Jason Banned
                      last edited by

                      GPP can be set to use the next available drive.

                      1 Reply Last reply Reply Quote 0
                      • Mike DavisM
                        Mike Davis
                        last edited by

                        how many computers have the card readers? Instead of messing with the rest of the company's drive letters you could script something like:

                        diskpart
                        select vol g
                        assign letter=b

                        You have to put the diskpart commands in .txt file and then specify that as the script for diskpart to use, but you get the idea. Just move the local media card reader to a letter that's not used by the company and be done with it.

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 2 / 2
                        • First post
                          Last post