how to change my drive letter (USB) to "G"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ilan
    Forum Member
    • Nov 2011
    • 16

    how to change my drive letter (USB) to "G"

    how to change my drive letter (USB) to "G"
    like evry time i put //disk on key// in my USB
    i put a test "button"
    that test my drive letter (USB)
    and only if it not "G:"
    on button click change the drive letter///to G:
    TNX
  • eleyea(sa)
    Forum Member
    • Aug 2009
    • 107

    #2
    may be if told us why you want to change your drive letter we may be able to help you ,,.

    Comment

    • ilan
      Forum Member
      • Nov 2011
      • 16

      #3
      Need help i find this toll.....DriveLetterView v1.11
      Allows you to change a drive letter from command line, for example:
      DriveLetterView.exe /change local k: l:
      -------
      how to do this
      if "Removable" is not g:
      than change it to G:
      TNX

      Comment

      • ilan
        Forum Member
        • Nov 2011
        • 16

        #4
        HI..because i have shared folder in my pc to my to "disk on key" to (ROOT)
        i need to do it ...so evry "disk on key" i put must have drive letter..G:
        please how to do it ?
        TNX

        Comment

        • Cybergraph
          Indigo Rose Customer
          • Feb 2007
          • 1633

          #5
          What about to read the user manual instead of ask others to do the job for you?

          You are asking for very basic stuff regarding how to use Conditions, Drive functions and File run commands.

          All this stuff is widely covered in the user manual.
          We are slowly invading your planet to teach lazy humans to read the user manual.
          But don't be scared: we are here to help.

          Comment

          • eleyea(sa)
            Forum Member
            • Aug 2009
            • 107

            #6
            That would be possible if the target machine doesn't contain a drive ( neither fixed nor removable ) with the letter G assigned to it so you can this as the following :
            Code:
            sDrive = _SourceDrive -- replace _SourceDrive with the drive letter you want to change .
            File.Run("AutoPlay\\Docs\\DriveLetterView.exe", "/change local "..sDrive.." G:", "", .....);
            i hope that will be helpful ,
            ELEYEA ,,.

            Comment

            • ilan
              Forum Member
              • Nov 2011
              • 16

              #7
              TNX TNX ...BUT my problem is
              when i put a NEW disk on key...i don't know what will be the drive letter.
              That's why... I want to do button (to fix it auto)
              That will examine what is the drive letter of the USB only..!!
              and if the USB "disk on key" not .....G:...hange a drive letter to G:
              TNX

              Comment

              • Cybergraph
                Indigo Rose Customer
                • Feb 2007
                • 1633

                #8
                @eleya

                I can not understand how you can be so stupid to submit a code that will be used by a beginner, and this code is dangerous because launches a program that, if run from the disk C:, could create a mess. In fact you use the internal variable _SourceDrive that indicates the drive where runs the AMS app, and the comment you added is unuseful - i bet that he will try the first time without substituting the drive variable.

                Is your fantasy so limited in a way that you are not able to invent a different variable name, like "connected_drive" for example?

                Fortunately your superficiality and haste to give an answer at any cost didn't allow you to clearly understand the question and give a complete answer, where the user was asking about how to create the condition to check the drive letter of the connected drive, and not how to run the DriveLetterView with parameters.

                TNX TNX ...BUT my problem is
                when i put a NEW disk on key...i don't know what will be the drive letter.
                That's why... I want to do button (to fix it auto)
                That will examine what is the drive letter of the USB only..!!
                and if the USB "disk on key" not .....G:...hange a drive letter to G:
                TNX
                In fact...

                how to create the condition to check the drive letter of the connected drive, and not how to run the DriveLetterView with parameters.
                We are slowly invading your planet to teach lazy humans to read the user manual.
                But don't be scared: we are here to help.

                Comment

                • eleyea(sa)
                  Forum Member
                  • Aug 2009
                  • 107

                  #9
                  Originally posted by Cybergraph View Post
                  @eleya

                  I can not understand how you can be so stupid to submit a code that will be used by a beginner, and this code is dangerous because launches a program that, if run from the disk C:, could create a mess. In fact you use the internal variable _SourceDrive that indicates the drive where runs the AMS app, and the comment you added is unuseful - i bet that he will try the first time without substituting the drive variable.

                  Is your fantasy so limited in a way that you are not able to invent a different variable name, like "connected_drive" for example?

                  Fortunately your superficiality and haste to give an answer at any cost didn't allow you to clearly understand the question and give a complete answer, where the user was asking about how to create the condition to check the drive letter of the connected drive, and not how to run the DriveLetterView with parameters.



                  In fact...
                  well , the cause that this code wasn't really perfected because i wrote it from my mobile i assumed at the moment i wrote that code that he will run the application from the usb drive he want to change its letter sorry but i didn't get the time to check it and by the way i'm not so stupid as you may think , LoL ,
                  ELEYEA ,,.

                  Comment

                  • reteset
                    Indigo Rose Customer
                    • May 2006
                    • 1692

                    #10
                    if G points to a partition in my second or third hard drive ??

                    you MUST NOT change drive letter

                    you must use _SourceDrive variable in your paths
                    amsplugins.com Is Closed.

                    Facebook Page

                    Comment

                    • ilan
                      Forum Member
                      • Nov 2011
                      • 16

                      #11
                      This particular computer has only c: d: e:
                      g: never in use..!
                      But when I get a USB flash disk....Not all the time i get it as G:
                      I just wanted to make a button that checks if it ...USB flash disk... and correct this
                      TNX

                      Comment

                      • Cybergraph
                        Indigo Rose Customer
                        • Feb 2007
                        • 1633

                        #12
                        you must use _SourceDrive variable in your paths
                        I'm very curious to know if the system allows you to change the drive letter of a drive by an executable that is running on just from that drive...

                        At least you will get 2 or 3 errors, like the app crashes because it no more finds its source exe file, and/or the letter change will not be allowed due to already running program from that letter and so on...

                        To make this kind of operation require a good planning of possible issues, and a series of routines able to check if the drive that need the letter changed is not a system or internal drive, if it is a removable drive, if there are not other programs or files open already running from that unit, if the chosen drive letter is not already in use and an hundred of other things.

                        Or use this program I created: http://www.oltrelimmagine.org/univer...tter/index.htm

                        if you create a shortcut that points to the file "G:\myfile.doc" and G: is a removable drive (like a pendrive or an external harddisk), very often happens that, expecially if you use more than one external drive, the next time you start Windows and connect that drive to your computer, the drive will have a different drive letter (say F: or H); the result is that the shortcut you created before will no longer be valid, generating an error every time you try to use it.

                        Or you could decide to assign a different drive letter to your drives, having to modify all shortcuts you previously created.

                        Differently, if you create a shortcut using Universal Shortcutter, the shortcut will be always valid and working, because Universal Shortcutter creates links based on the real "identity" of the drive, not on the assigned letter of the drive that is "volatile".
                        Last edited by Cybergraph; 11-28-2011, 05:33 PM.
                        We are slowly invading your planet to teach lazy humans to read the user manual.
                        But don't be scared: we are here to help.

                        Comment

                        • ilan
                          Forum Member
                          • Nov 2011
                          • 16

                          #13
                          TNX men but i wont to try to do it ile this//can you help me
                          -- ################################################## ##########################################
                          -- ## This function differentiates between genuine USB sticks and the false-positives which get
                          -- ## returned by Floppy-Drives and/or USB-Modems, via the Serial-Number unique to USB sticks.
                          -- ################################################## ##########################################
                          -- Set the USB DriveType variable
                          drive_type = "2"
                          -- Enumerate the Drives on the system
                          tblDrives = Drive.Enumerate();
                          -- Step thru the table to process each drive
                          for n, DriveLetter in pairs (tblDrives) do
                          -- Get the DriveType
                          nType = Drive.GetType(DriveLetter)
                          -- If the DriveType equals the DriveType string, get its Serial-Number, and display.
                          if nType == String.ToNumber(drive_type) then
                          sSerial = DLL.CallFunction("AutoPlay\\Docs\\DriveSer.dll", "DriveSerialNumber", "\""..DriveLetter.."\"", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
                          if sSerial ~= "ERROR" then
                          Dialog.Message("Notice", "Valid USB Flash Drive detected on: Drive " .. DriveLetter, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
                          --------
                          if nType == String.ToNumber(drive_type)~= "G:/" then
                          File.Run("AutoPlay\\Docs\\DriveLetterView.exe", "/change local "..sDrive.." G:", "", .....);
                          --------
                          end
                          end
                          end
                          end
                          -- Otherwise display a "No Valid USB Flash Drives" Message
                          if sSerial == "ERROR" then
                          Dialog.Message("No USB Drives Detected", "No valid USB Flash Drives detected.\r\nPlease insert a valid drive\r\nand then restart this application.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
                          end

                          Comment

                          • ilan
                            Forum Member
                            • Nov 2011
                            • 16

                            #14
                            Cybergraph.... HI.....can you see this CODE it is your code..!!!
                            see if it ok
                            TNX
                            ----------
                            drives = Drive.Enumerate();
                            for j in pairs(drives) do
                            drive_type = Drive.GetType(drives[j]);
                            if drive_type == 2 then
                            drive_letter = String.Left(drives[j], 1); -- ... takes only the drive letter (without :\)
                            if drive_letter ~= "A" and drive_letter ~= "B" and drive_letter ~= "C" then
                            root_folder_does_exist = Folder.DoesExist(drive_letter..":\\");
                            if root_folder_does_exist then
                            Current_Serial = Drive.GetInformation(drives[j]).SerialNumber;
                            Current_Label = Drive.GetInformation(drives[j]).Label;
                            Current_Name = Drive.GetInformation(drives[j]).DisplayName;
                            Dialog.Message("", "Valid USB Flash Drive detected on: Drive "..drive_letter);
                            end
                            end
                            end
                            end

                            if drive_type ~= 2 then
                            Dialog.Message("àæäøä", "No USB Drives Detected", "No valid USB Flash Drives detected.\r\nPlease insert a valid drive\r\nand then restart this application.");
                            end
                            if drive_letter=="G" then

                            Dialog.Message("", "OKKKKKKKKKKKKKKK..Valid USB Flash Drive detected on: Drive "..drive_letter);
                            end
                            if drive_letter~="G" then

                            Dialog.Message("", "ERRRRRRRRRRRRRRRRRRRRRRRR: Drive "..drive_letter);
                            end

                            Comment

                            Working...
                            X