Regsvr32 to Text

Discussion in 'OT Technology' started by Sirris, Mar 19, 2007.

  1. Sirris

    Sirris New Member

    Joined:
    Nov 4, 2002
    Messages:
    953
    Likes Received:
    0
    Location:
    Sydney, Australia
    Hey,

    I have been asked to create a batch file that will send all it's output boxes to a log file.

    A sample is of the entries:
    regsvr32 acelpdec.ax
    regsvr32 actxprxy.dll
    regsvr32 actxprxy.dll
    regsvr32 asctrls.ocx
    regsvr32 atl.dll
    regsvr32 browseui.dll /I
    regsvr32 cdfview.dll
    regsvr32 comcat.dll

    I know that if I pipe it using the > c:\[Location].txt it will create a text file but when I open it, the file is blank and I still get the prompts...

    Can anyone help us out please?
     
  2. Wolf68k

    Wolf68k OT Supporter

    Joined:
    Dec 18, 2003
    Messages:
    4,861
    Likes Received:
    2
    Location:
    Houston, Texas
    In the text file you type exactly what you have
    regsvr32 <whatever>.<whatever>

    Save the text file but rename the extension from TXT to BAT
    Then all you do is double click the BAT file and it'll run the commands
     
  3. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    No, he wants THE OUTPUT to go to a text file instead of to the screen.

    http://www.sophos.com/support/knowledgebase/article/13195.html

    Scroll about 80% of the way down the page.
     
  4. peerk

    peerk New Member

    Joined:
    Mar 14, 2005
    Messages:
    984
    Likes Received:
    0
  5. peerk

    peerk New Member

    Joined:
    Mar 14, 2005
    Messages:
    984
    Likes Received:
    0
    Something like this in a batch file should work. Here are the first 3.

    Code:
    regsvr32 /s acelpdec.ax
    if %ERRORLEVEL% GEQ 1 (echo acelpdec.ax: failed to register >> log.txt) else echo acelpdec.ax: Registered Successfully >> log.txt
    
    regsvr32 /s actxprxy.dll
    if %ERRORLEVEL% GEQ 1 (echo actxprxy.dll: failed to register >> log.txt) else echo actxprxy.dll: Registered Successfully >> log.txt
    
    regsvr32 /s asctrls.ocx
    if %ERRORLEVEL% GEQ 1 (echo asctrls.ocx: failed to register >> log.txt) else echo asctrls.ocx: Registered Successfully >> log.txt
    

    After regsvr32 exits the return code is checked. A return code of 0 usually means there were no problems. Based on the return code it outputs to log.txt.
     
  6. Sirris

    Sirris New Member

    Joined:
    Nov 4, 2002
    Messages:
    953
    Likes Received:
    0
    Location:
    Sydney, Australia
    Thanks heaps!!!

    I've been trying to figure it out for a month.
     

Share This Page