Can't run regsvr32 from .bat file, but can run from CMD

Page 1 of 3 123 LastLast

  1. Posts : 12
    Windows 7 Pro 64-bit
       #1

    Can't run regsvr32 from .bat file, but can run from CMD


    Hi All, I've been pulling my hair out trying to resolve this issue, but I'm stuck and hoping one of you can assist. I'm trying to install some software (an exe) which calls a batch file to register a dll. During the install it hangs on CMD.

    The contents of the .bat file are:
    Code:
    regsvr32 /s CSEShellNsExt.dll
    If I double click the .bat file it just hangs (please see the batch.png screenshot).

    However, if I open a CMD prompt, cd to that location, and then run the command (regsvr32 /s CSEShellNsExt.dll) it works fine and returns me back to the prompt (please see cmd.png).

    I've also tried running regsvr32 via the cmd.exe located in system32 and syswow64. Either way those return me to the command prompt and do not hang or throw an error message.

    I can manually register those entries, however I believe another install of mine is not finishing due to this problem and I'm stuck. I should definitely be able to double click on the .bat file and it should just run the command, which I can manually run from the cmd prompt.

    Thanks for any assistance you can provide, I REALLY appreciate it!
    Attached Thumbnails Attached Thumbnails Can't run regsvr32 from .bat file, but can run from CMD-batch.png   Can't run regsvr32 from .bat file, but can run from CMD-cmd.png  
      My Computer


  2. Posts : 10,485
    W7 Pro SP1 64bit
       #2

    Welcome to the Seven Forums.

    Judging from your screenshots, the command prompt window needs to be run with elevated privileges (run as admin...).
      My Computer


  3. Posts : 12
    Windows 7 Pro 64-bit
    Thread Starter
       #3

    Thanks for taking a look and replying. If I run the .bat as an Admin I get the same results. The cmd.exe doesn't run as elevated. Weird!

    By the way I've recently reformatted this machine since I had this problem before. It's a clean install and I'm the only user and a full Admin.
    Attached Thumbnails Attached Thumbnails Can't run regsvr32 from .bat file, but can run from CMD-problem.png  
      My Computer


  4. Posts : 10,485
    W7 Pro SP1 64bit
       #4

    Hmm, I've never noticed that the title does not reflect the elevated status for such a batch file.

    If I test an elevated and non-elevated bat file containing:
    Code:
    dir
    pause
    I do get "as expected" results - except for the window title.

    The non-elevated bat file shows the folders/files on the desktop (since that is the where the test bat file was located).

    The elevated bat file shows the folders/files in the windows system32 folder (since that is the default folder for elevated command prompts).

    What happens if you change the directory (CD) to the folder of interest before attempting to register the DLL?
    Last edited by UsernameIssues; 11 Apr 2013 at 05:23. Reason: typo
      My Computer


  5. Posts : 12
    Windows 7 Pro 64-bit
    Thread Starter
       #5

    If I create a bat file with dir and pause they both give me the desktop contents whether I run elevated or not.

    The thing is that I can run regsvr32 just fine when I cd to the dll location. BUT, a bat file that calls (regsvr32 blah.dll) hangs every time (elevated or not).
      My Computer


  6. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #6

    post the bat file please
      My Computer


  7. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #7

    Remove /s from regsvr32 command so:

    Code:
    regsvr32  CSEShellNsExt.dll
    and try again
      My Computer


  8. Posts : 12
    Windows 7 Pro 64-bit
    Thread Starter
       #8

    The entire batch file is:

    Code:
    regsvr32 /s CSEShellNsExt.dll
    The problem is double clicking the bat just hangs, but opening a CMD window and typing in the command works. All of this should technically be done by the actual installer but it ends up hanging and I've traced it to this issue.
      My Computer


  9. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #9

    try this as test in bat file:

    regsvr32 CSEShellNsExt.dll

    or

    regsvr32 filenotfound.dll
      My Computer


  10. Posts : 12
    Windows 7 Pro 64-bit
    Thread Starter
       #10

    Ok, in that case the real dll just hangs (no change). On filenotfound.dll I receive an error: the module filenotfound.dll failed to load...make sure the binary is stored at the specified path...
      My Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:33.
Find Us