Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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

10 Apr 2013   #1
jamesaru

Windows 7 Pro 64-bit
 
 
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 Images
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 System SpecsSystem Spec
.
10 Apr 2013   #2
UsernameIssues

W7 Pro SP1 64bit
 
 

Welcome to the Seven Forums.

Judging from your screenshots, the command prompt window needs to be run with elevated privileges (run as admin...).
My System SpecsSystem Spec
10 Apr 2013   #3
jamesaru

Windows 7 Pro 64-bit
 
 

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 Images
Can't run regsvr32 from .bat file, but can run from CMD-problem.png 
My System SpecsSystem Spec
.

10 Apr 2013   #4
UsernameIssues

W7 Pro SP1 64bit
 
 

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?
My System SpecsSystem Spec
10 Apr 2013   #5
jamesaru

Windows 7 Pro 64-bit
 
 

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 System SpecsSystem Spec
10 Apr 2013   #6
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

post the bat file please
My System SpecsSystem Spec
10 Apr 2013   #7
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Remove /s from regsvr32 command so:

Code:
regsvr32  CSEShellNsExt.dll
and try again
My System SpecsSystem Spec
10 Apr 2013   #8
jamesaru

Windows 7 Pro 64-bit
 
 

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 System SpecsSystem Spec
10 Apr 2013   #9
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

try this as test in bat file:

regsvr32 CSEShellNsExt.dll

or

regsvr32 filenotfound.dll
My System SpecsSystem Spec
10 Apr 2013   #10
jamesaru

Windows 7 Pro 64-bit
 
 

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 System SpecsSystem Spec
Reply

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




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
regsvr32 error
I am trying to register bthserv.dll in my registry as the bluetooth support service is missing from my services.msc; Dont ask how that happened! when running the command regsvr32 bthserv.dll im getting the error message; "the module bthserv.dll was loaded but the entry-point dllregisterserver...
BSOD Help and Support
Regsvr32 Error - PLEASE HELP
Hi All, I keep getting this error message every time I log on to my laptop. It's windows 7 64 bit. "The Module "C:\ProgramData\xklyoryq.dat" failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files" ...
General Discussion
RegSvr32 Issue
The module was loaded but its entry for dll register server was not found. I suspect due to the file was downloaded from unreliable source. So what i do is try to compare from other file system that already installed in the same directory but different folder. And here's the result...
General Discussion
Regsvr32 Problems
Hi, Im running windows 7 ultimate x64 and trying to register a dll file using regsvr32, but everytime i try to in command prompt i get this error. I also tried: Running CMD as admin. Putting the dll file in the directory with the programme im trying to run. i also tried to put the dll both in...
General Discussion
regsvr32 keeps running (dialog boxes missing)
Hello World, I have a programm that is copying a file (and its needed .dll files) to a selected folder. After the copy process the .dll files need to be registered with regsvr32. This is also part of the programm. On WIN XP there have been shown a dialog box that the regstration have been...
General Discussion
Regsvr32 cannot find which program Files
I am having an import wizard problem in MS Access 2007. In trying to fix the problem, I am trying to register dao60.dll ans msado15.dll. Unfortunately, it doesn't recognize Program Files (x86) and the .dlls are not in Program Files. Any suggestions?
General Discussion


Our Sites

Site Links

About Us

Find 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 22:42.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App