title
Products            Buy            Support Forum            Professional            About            Codec Central
 

32-bit Command Prompt Dilemma with DMC Scripting......

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lonelon2000

    • Apr 2011
    • 6

    32-bit Command Prompt Dilemma with DMC Scripting......

    I was looking for a way to capture audio property information (specifically sample-size) along with tag information so I could write a PowerShell script that will rename the file based on that data. I had quite a bit of success in doing so; I was able to write a script using an object created with dMCScripting.Converter and pull the information I needed, parsed it and then renamed the file. I ultimately was going to use the script as a tool in MP3Tag, which is a 32-bit application. I was able to successfully configure MP3Tag to pass the full path of the file to the script and run it, however, since it is a 32-bit application, it launches a 32-bit command prompt, because it is running in the 32-bit "space". This causes the COM object not to create because it is registered under a 64-bit dll.

    I created a Windows XP virtual machine and installed dbPowerAmp on it (I have the family license), pulled the 32-bit DLL from it, and placed it on my 64-bit machine. I was able to register the DLL, and it works in a 32-bit command prompt, but the AudioProperties function does not return any data.


    Do you even support running the 32-bit DLL on a 64-bit machine?

    I've also tried creating a symbolic link to the 64-bit command prompt after unregistering the 32-bit DLL and re-registering the 64-bit one, so that MP3Tag will attempt to launch the script in a 64-bit window, but that doesn't seem to work either, because it still only launches the 32-bit prompt.

    Any suggestions?
  • lonelon2000

    • Apr 2011
    • 6

    #2
    Re: 32-bit Command Prompt Dilemma with DMC Scripting......

    This is the line of code that is throwing the error:

    Code:
    $dMC = New-Object -ComObject dMCScripting.Converter
    Here is the actual error from a PowerShell (x86) prompt:

    New-Object : Retrieving the COM class factory for component with CLSID {1C2E0932-61B5-4EAB-A832-06EE6564047D} failed due to the following error: 800700c1.
    At C:\PowerShell\SingleArtistAlbum-FileRename.ps1:5 char:18
    + $dMC = New-Object <<<< -ComObject dMCScripting.Converter
    + CategoryInfo : NotSpecified: ( [New-Object], BadImageFormatException
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShel l.Commands.NewObjectCommand


    I receive the same error even if I include these lines in the script above the creation of the new COM object:

    Code:
    C:\Windows\System32\regsvr32.exe "C:\Program Files (x86)\Illustrate\dBpoweramp\dMCScripting.dll"
    C:\Windows\SysWOW64\regsvr32.exe "C:\Program Files (x86)\Illustrate\dBpoweramp\dMCScripting.dll"
    I get 2 message boxes saying that they registered successfully, but the script still fails.

    When I implement this in the script:

    Code:
    C:\Windows\System32\regsvr32.exe /u "C:\Program Files (x86)\Illustrate\dBpoweramp\dMCScripting.dll"
    C:\Windows\SysWOW64\regsvr32.exe "C:\Program Files (x86)\Illustrate\dBpoweramp\dMCScripting32.dll" *copied and renamed from WindowsXP installation
    no error is returned, but no data is captured from the methods ReadIDTagElementValue and AudioProperties.
    Last edited by lonelon2000; July 12, 2013, 01:40 PM.

    Comment

    • Spoon
      Administrator
      • Apr 2002
      • 44505

      #3
      Re: 32-bit Command Prompt Dilemma with DMC Scripting......

      I do not think the 32 bit dll will work, because the code in the 32 bit dll will detect is on Win64 and try to operate as 64 bit (even though is 32 bit).

      Perhaps investigate using .vbs files and shell execute as a go between.
      Spoon
      www.dbpoweramp.com

      Comment

      • lonelon2000

        • Apr 2011
        • 6

        #4
        Re: 32-bit Command Prompt Dilemma with DMC Scripting......

        Thanks for the suggestion, Spoon, I will give it a try.

        So are you saying that the 64-bit dll will work in a 32-bit prompt if I run it in a vbs script? I'm not so sure that it will make a difference. The 32-bit dll probably should detect the runspace that it is in and just function normally. I've had some experience with running Lotus Notes dlls in PowerShell, which is 32-bit, and it runs fine on a 64-bit system... as long as I run it in a 32-bit or x86 prompt. The COM objects load just fine from there. The same can be said for Microsoft Office when the 32-bit version is installed. This maybe because the installs themselves are 32-bit...

        I've tried the shell execute I believe... but it's been a while since I've done any coding with vbs scripts, so it may take a while for me to get back to you on this. If it doesn't work... then I may have try fumbling around further with the symbolic link I created to launch the script in 64-bit.

        Comment

        • Spoon
          Administrator
          • Apr 2002
          • 44505

          #5
          Re: 32-bit Command Prompt Dilemma with DMC Scripting......

          Shell Execute is correct, you use the vbs script as a go between, perhaps writing to files which you can pickup.

          A 32 bit program can start a 64 bit program.
          Spoon
          www.dbpoweramp.com

          Comment

          • lonelon2000

            • Apr 2011
            • 6

            #6
            Re: 32-bit Command Prompt Dilemma with DMC Scripting......

            I got it to work!! I was fumbling around, and learned that the awesome folks @ Quest included in the free version of PowerGUI the ability to compile an executable from a PowerShell script. Once I updated it to accept parameters as an executable and complied it... it works!! No need to try scripting in VB

            Thanks for all you help Spoon. I am most certainly one happy camper!!

            Comment

            • lonelon2000

              • Apr 2011
              • 6

              #7
              Re: 32-bit Command Prompt Dilemma with DMC Scripting......

              I finally got it to work! I ended up not having to write any VB code. In PowerGUI, I learned that you have the option to compile a PowerShell script in an executable. This allows it to run the 64-bit code at a 32-bit command prompt and not throw an error. Once that was done, it was just a matter of getting it to accept the file path of the audio file as a parameter. It runs like a champ as a tool in MP3Tag now. I can now focus on putting the rest of the clothes on the script to make it handle different scenarios, and create more executables for multiple filename formats.

              Thanks for your suggestions, Spoon!

              Comment

              Working...

              ]]>