Passing CD drive letter to command line argument

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Metatron
    Forum Member
    • Feb 2004
    • 6

    Passing CD drive letter to command line argument

    I am trying to mount an ISO image file to a virtual drive on the client computer.
    All the clients use Alcohol. Basically, I need to determine the drive letter the the Autoplay CD is in and pass that to the command line argument for the Alcohol virtual drive loader.

    The command line argument is in this format:
    [Drive]: /M:[Path] [Filename]

    How do I determine the drive the CD is in and pass it to the command line argument?
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3967

    #2
    Dialog.Message("Your CD Drive is", _SourceDrive)

    Comment

    • Metatron
      Forum Member
      • Feb 2004
      • 6

      #3
      Thanks Worm, that was quick. Now I need to insert the drive letter into the command line argument in Alcohol.

      Comment

      • Worm
        Indigo Rose Customer
        • Jul 2002
        • 3967

        #4
        "X: /M " .. _SourceDrive .. "\\ISO\\Something.iso"

        Comment

        • Metatron
          Forum Member
          • Feb 2004
          • 6

          #5
          Thanks again. Alcohol didn't like that. I guess I'm stuck doing it the long way.
          I'm having syntax trouble with the following

          local CD_Drive = "_SourceDrive";
          if ("CD_Drive"="D")
          then File.Run("C:\\Program Files\\Alcohol Soft\\Alcohol 120\\AxCmd.exe", "1: \M:\\Autoplay\\Docs\\ISO\\User Data.iso", "", SW_SHOWNORMAL, false)

          I have the if-then statements Copied to reach all drive letters between D and N

          Please tell me what I'm doing wrong.

          Comment

          • SUF6NEWBIE

            #6
            just quickly...

            try changing:
            local CD_Drive = "_SourceDrive";
            if ("CD_Drive"="D")

            to:

            local CD_Drive = _SourceDrive;
            if (CD_Drive == "D:")


            check the return string(syntax) for _SourceDrive

            ..may be returned as D: or D:\

            Comment

            • Roboblue
              Forum Member
              • Dec 2003
              • 892

              #7
              Worm will your drive serial dll see a virtual drive?

              Because if it will, you can have a list box show the drive letter and use the selection as a variable to pass the command.
              just a thought. I don't have a virtual drive setup right now to test.

              Comment

              • SUF6NEWBIE

                #8
                Yes it should..if iso is mounted with a valid ISO,

                virtual drives(drivers etc) are written to behave(mimic) a standard
                cdrom peripheral device at the very least.(autorun etc etc)

                don't forget AMS V5020 now has this functionality built in...


                ..if the OS has allocated a drive letter for the virtual drive it will
                be 'enumerated' like any other allocated 'dos device' letter.

                So the listbox idea will work...
                Last edited by Guest; 01-21-2005, 04:25 PM.

                Comment

                • Worm
                  Indigo Rose Customer
                  • Jul 2002
                  • 3967

                  #9
                  Try this:
                  Code:
                  local CD_Drive = _SourceDrive;
                  File.Run("C:\\Program Files\\Alcohol Soft\\Alcohol 120\\AxCmd.exe", "1: \M:".. CD_DRIVE .."\\Autoplay\\Docs\\ISO\\User Data.iso", "", SW_SHOWNORMAL, false)

                  Originally posted by Metatron
                  Thanks again. Alcohol didn't like that. I guess I'm stuck doing it the long way.
                  I'm having syntax trouble with the following

                  local CD_Drive = "_SourceDrive";
                  if ("CD_Drive"="D")
                  then File.Run("C:\\Program Files\\Alcohol Soft\\Alcohol 120\\AxCmd.exe", "1: \M:\\Autoplay\\Docs\\ISO\\User Data.iso", "", SW_SHOWNORMAL, false)

                  I have the if-then statements Copied to reach all drive letters between D and N

                  Please tell me what I'm doing wrong.

                  Comment

                  • Metatron
                    Forum Member
                    • Feb 2004
                    • 6

                    #10
                    Thanks to all of you. Worm, both of your suggestions worked great. In the end, it turned out that the problem was with the file name. Once I got rid of the space in User Data.iso it kicked right in.
                    Sorry to be such a noob or newb, however it's spelled 'round these parts.

                    Does this mean I have to go back to DOS thought? Will it give me grief over files and folders with more than 8 letters too? :lol

                    Comment

                    • Worm
                      Indigo Rose Customer
                      • Jul 2002
                      • 3967

                      #11
                      Nah, you just need to enclose that path in quotes, sorry I didn't catch that.

                      Code:
                      local CD_Drive = _SourceDrive;
                      File.Run("C:\\Program Files\\Alcohol Soft\\Alcohol 120\\AxCmd.exe", "1: \M:\"".. CD_DRIVE .."\\Autoplay\\Docs\\ISO\\User Data.iso\"", "", SW_SHOWNORMAL, false)
                      Or use AMS's built in function to get the ShortName
                      Code:
                      local CD_Drive = _SourceDrive;
                      CD_ISO = File.GetShortName(CD_DRIVE .."\\Autoplay\\Docs\\ISO\\User Data.iso");
                      File.Run("C:\\Program Files\\Alcohol Soft\\Alcohol 120\\AxCmd.exe", "1: \M:".. CD_ISO, "", SW_SHOWNORMAL, false);
                      Last edited by Worm; 01-22-2005, 01:57 PM.

                      Comment

                      • Metatron
                        Forum Member
                        • Feb 2004
                        • 6

                        #12
                        Now that that's working, I'm having another little problem. It loads the ISO into the virtual drive, but it won't run it. I found Worm's DriveLabelSerial.apz, and adjusted it for my needs, but it's not finding the drive. As usual, I need help figuring out what I'm doing wrong. Here's what I've done to it, it will only return the last drive on the chain.

                        CD=_SourceDrive;
                        File.Run("C:\\Program Files\\Alcohol Soft\\Alcohol 120\\AxCmd.exe", "1: /M:".. CD .."\\AutoPlay\\Docs\\ISO\\User Data.iso", "", SW_SHOWNORMAL, false);
                        Dialog.TimedMessage("Please Wait...", "Please wait while the Virtual Drive loads", 15000, MB_ICONINFORMATION);
                        -- get the drives on the system
                        tblDrives = Drive.Enumerate();

                        -- walk the table to process each drive
                        sDataDrive = "";
                        for n, DriveLetter in tblDrives do
                        --Get the drive type
                        nType = Drive.GetType(DriveLetter);

                        -- if the type equals 5 (CD ROM), get it's Label, and Serial
                        -- and add the information to the listbox.
                        if nType == 5 then
                        sLabel = DLL.CallFunction("AutoPlay\\Docs\\DriverSer.dll", "DriveLabel", "\""..DriveLetter.."\"", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL);
                        if String.Upper("sLabel") == "USERDATA" then
                        sDataDrive = DriveLetter;
                        end
                        end
                        end
                        File.Run("".. sDataDrive .."\\autorun.exe", "", "", SW_SHOWNORMAL, false);


                        I copied the dll to the docs folder. the script seems to run fine, it's just not stopping at the "USERDATA" drive.

                        Comment

                        • csd214
                          Forum Member
                          • Oct 2001
                          • 939

                          #13
                          I was just stepping by in a hurry. Please forgive me if I'm outside the track.

                          If your code really is

                          if String.Upper("sLabel") == "USERDATA" then

                          I think you should try sLabel WITHOUT THE QUOTES.

                          Comment

                          • Roboblue
                            Forum Member
                            • Dec 2003
                            • 892

                            #14
                            Question

                            Is the drive you are looking for always going to be labeled USERDATA? Just checking to see if you are querying the right drive label.
                            I put up an example of a drive serial checking app using Worm's dll. you can get it here Drive Serial Utility . It shows a lot of code for the use of the dll.

                            Comment

                            • Worm
                              Indigo Rose Customer
                              • Jul 2002
                              • 3967

                              #15
                              Originally posted by csd214
                              I was just stepping by in a hurry. Please forgive me if I'm outside the track.

                              If your code really is

                              if String.Upper("sLabel") == "USERDATA" then

                              I think you should try sLabel WITHOUT THE QUOTES.
                              CSD has the eagle eye here. Change this line:

                              if String.Upper("sLabel") == "USERDATA" then

                              to

                              if String.Upper(sLabel) == "USERDATA" then

                              Comment

                              Working...
                              X