regsvr32 /s twext.dll and regsvr32 /u /s twext.dll giving Exit Code: 4

BatchPatch Forums Home Forums BatchPatch Support Forum regsvr32 /s twext.dll and regsvr32 /u /s twext.dll giving Exit Code: 4

  • This topic has 6 replies, 2 voices, and was last updated 8 years ago by mortega.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9284
    mortega
    Participant

    regsvr32 /s twext.dll and regsvr32 /u /s twext.dll giving Exit Code: 4 on Execute Remote Command. Please advise.

    #11426
    doug
    Moderator

    BatchPatch returns the error that was reported by regsvr32 on the target machine, so I don’t think this is a BP error, but rather it’s an error from regsvr32. Googling reveals that the exit 4 is probably indicating an issue with locating the dll in question. Perhaps try the full path instead of just the .dll name?

    https://stackoverflow.com/questions/22094309/regsvr32-exit-codes-documentation

    -Doug

    #11427
    mortega
    Participant

    Wow… Thank you so much for the quick response and the suggestion. I did some research and ran a test and it turns out that it was failing because it didn’t have the proper registry entry. I found these two settings and created two batch files.

    Shadow Copies Disable.bat

    regsvr32 /u /s twext.dll

    if errorlevel 1 REG ADD HKLMSoftwareMicrosoftWindowsCurrentVersionExplorer /V NoPreviousVersionsPage /T REG_DWORD /D 1

    Shadow Copies Enable.bat

    regsvr32 /s twext.dll

    if errorlevel 1 REG ADD HKLMSoftwareMicrosoftWindowsCurrentVersionExplorer /V NoPreviousVersionsPage /T REG_DWORD /D 0

    The first time I execute the batch file using Deploy Software batch/script/regkey/etc it worked great but when I run the opposing batch file it shows “Deployment: Executing” and the the path to the copied bat file on the target machine.

    I tested the batch file and the first time I ran it on my system it worked as expected but the second time it prompted me for a response. How can I force it to say ‘Yes’? Thanks again for the quick response Doug!

    C:UsersmxoDesktop>regsvr32 /u /s twext.dll

    C:UsersxxxxxDesktop>if errorlevel 1 REG ADD HKLMSoftwareMicrosoftWindowsCur

    rentVersionExplorer /V NoPreviousVersionsPage /T REG_DWORD /D 1

    Value NoPreviousVersionsPage exists, overwrite(Yes/No)?

    #11428
    mortega
    Participant

    Forgot to add, that after I manually type in Yes and press Enter, each of the batch files work as expected. I was hoping to get some assistance as to how to automate that response into the is process somehow? Thank you!

    #11430
    doug
    Moderator

    Maybe try /f which according to the link below “Adds the registry entry without prompting for confirmation.”

    https://technet.microsoft.com/en-us/library/cc742162(v=ws.11).aspx

    -Doug

    #11436
    mortega
    Participant

    Thanks for the info, I’ll give that a shot

    #11440
    mortega
    Participant

    Adding the /f at the end of the script worked great! Thank you Doug!

    Shadow Copies Disable.bat

    regsvr32 /u /s twext.dll

    if errorlevel 1 REG ADD HKLMSoftwareMicrosoftWindowsCurrentVersionExplorer /V NoPreviousVersionsPage /T REG_DWORD /D 1 /f

    Shadow Copies Enable.bat

    regsvr32 /s twext.dll

    if errorlevel 1 REG ADD HKLMSoftwareMicrosoftWindowsCurrentVersionExplorer /V NoPreviousVersionsPage /T REG_DWORD /D 0 /f

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.