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   #11
Kaktussoft

Microsoft Community Contributor Award Recipient

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

Code:
regsvr32 CSEShellNsExt.dll
Works in command prompt (impossible)?
Works in command prompt with admin rights?


My System SpecsSystem Spec
.
10 Apr 2013   #12
Kaktussoft

Microsoft Community Contributor Award Recipient

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

Quote   Quote: Originally Posted by jamesaru View Post
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!
The bat file has to bu run with admin rights!! So elevated!
My System SpecsSystem Spec
10 Apr 2013   #13
jamesaru

Windows 7 Pro 64-bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
Code:
regsvr32 CSEShellNsExt.dll
Works in command prompt (impossible)?
Works in command prompt with admin rights?
Every time I run cmd it's elevated so I'm not sure how to test if regsvr32 will run in a non-elevated command prompt.
My System SpecsSystem Spec
.

10 Apr 2013   #14
jamesaru

Windows 7 Pro 64-bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
The bat file has to bu run with admin rights!! So elevated!
Running it as Administrator doesn't change anything (right click run as Admin). I posted some screenshots earlier. Elevated or not any time I click on that batch file it hangs. Therefore if an installer is trying to call a batch file it also hangs.
My System SpecsSystem Spec
11 Apr 2013   #15
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
~~~
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).
~~~
Quote   Quote: Originally Posted by jamesaru View Post
If I create a bat file with dir and pause they both give me the desktop contents whether I run elevated or not......
The elevation process normally changes the directory to C:\Windows\system32 (unless you do something like this). Most likely, neither of the cmd windows shown in your OP went thru the elevation process. I should have noticed that the second screenshot in your OP (the one that has Administrator: in the title) is starting in a non-standard directory.

My guess is that both give you the desktop's contents because you are operating in a non-recommended way:

1) You have User Account Control turned off and...
...you are logged in using an account with admin rights*.

2) You are logged in using the built in Administrator account*.

3) You have User Account Control turned off and...
...you are logged in using an account with standard rights**.

*Thus everything runs at either the system integrity level or the high integrity level. The cmd window was launched via explorer. Explorer was already running at a high integrity level. The cmd prompt window inherited its high integrity level from explorer (desktop). The cmd prompt window did not go thru the elevation process. For an admin user with the UAC off (or for the built in Administrator account), both ways of starting the "dir" bat file would yield the desktop's contents.

**Not really plausible since post #3 states that you are "the only user and a full Admin", but a standard account would not be able to elevate a process if UAC is turned off - not without jumping thru some hoops. Double clicking on a the "dir" bat file would run it in at the medium integrity level. Right clicking and selecting "run as admin..." will transparently fail to elevate. The cmd window was launched via explorer. Explorer was running at a medium integrity level. The cmd prompt window inherited its medium integrity level from explorer (desktop). The cmd prompt window did not go thru the elevation process. For a standard user with the UAC off, both ways of starting the "dir" bat file would yield the desktop's contents.

Of course, I could be wrong about all of the above :-)



Quote   Quote: Originally Posted by jamesaru View Post
...The thing is that I can run regsvr32 just fine when I cd to the dll location....
So, like I asked before:

Quote   Quote: Originally Posted by UsernameIssues View Post
~~~
What happens if you change the directory (CD) to the folder of interest before attempting to register the DLL?
But maybe I was not clear. I wanted you to test this code in a bat file.

Code:
CD "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin"
regsvr32 /s CSEShellNsExt.dll
My System SpecsSystem Spec
11 Apr 2013   #16
Kaktussoft

Microsoft Community Contributor Award Recipient

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

C:
CD "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin"
regsvr32 CSEShellNsExt.dll


does work from bat file (elevated)?

the batfile is already in "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin" ? that's why you see "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin" in the output... quite normal.
My System SpecsSystem Spec
11 Apr 2013   #17
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
......
the batfile is already in "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin" ? that's why you see "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin" in the output... quite normal.
Was that directed at me or the OP?
My System SpecsSystem Spec
11 Apr 2013   #18
Kaktussoft

Microsoft Community Contributor Award Recipient

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

Quote   Quote: Originally Posted by UsernameIssues View Post
Quote   Quote: Originally Posted by Kaktussoft View Post
......
the batfile is already in "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin" ? that's why you see "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin" in the output... quite normal.
Was that directed at me or the OP?
Driected to OP
My System SpecsSystem Spec
11 Apr 2013   #19
jamesaru

Windows 7 Pro 64-bit
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
~~~
What happens if you change the directory (CD) to the folder of interest before attempting to register the DLL?
But maybe I was not clear. I wanted you to test this code in a bat file.

Code:
CD "C:\Program Files\Dassault Systemes\IEFClientV6R2013xv3\bin"
regsvr32 /s CSEShellNsExt.dll
[/QUOTE]

Ahhh, sorry I guess I didn't catch that. When I create a batch file with that code it hangs just like it does when running from the original location.
My System SpecsSystem Spec
11 Apr 2013   #20
UsernameIssues

W7 Pro SP1 64bit
 
 

Do you have UAC turned off?
Are you on an admin account or on the Administrator (built in) account?
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 03:15.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App