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: No REG Command in "Open elevated command window here" DOS Box

16 May 2012   #21
MilesAhead

Windows 7 32 bit
 
 

I think what is happening in 64 bit cmd.exe if the OP is in C:\Windows\SysWow64 and runs reg.exe, the 32 bit emulation copy exists and the command is found. Perhaps it's being redirected to C:\Windows\System32 to use the 64 bit version. If the current directory is C:\Windows\System32 then it should definitely find the 64 bit reg.exe.

First thing I would try is make a batch with the exact path of reg.exe. Like DoReg.cmd with
Code:
@echo off
C:\Windows\System32\reg.exe %*
the %* should pass on the entire command tail unaltered. That way you don't have to worry about how many args the command takes.

That should force cmd.exe to find reg.exe


My System SpecsSystem Spec
.
16 May 2012   #22
Kaktussoft

Microsoft Community Contributor Award Recipient

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

Quote   Quote: Originally Posted by MilesAhead View Post
I think what is happening in 64 bit cmd.exe if the OP is in C:\Windows\SysWow64 and runs reg.exe, the 32 bit emulation copy exists and the command is found. Perhaps it's being redirected to C:\Windows\System32 to use the 64 bit version. If the current directory is C:\Windows\System32 then it should definitely find the 64 bit reg.exe.

First thing I would try is make a batch with the exact path of reg.exe. Like DoReg.cmd with
Code:
@echo off
C:\Windows\System32\reg.exe %*
the %* should pass on the entire command tail unaltered. That way you don't have to worry about how many args the command takes.

That should force cmd.exe to find reg.exe
If in C:\Windows\System32 => reg.exe 64 bits will run
If in C:\Windows\SysWow64 => reg.exe 32 bits will run

if in C:\whateverelse=> reg.exe isn't there and it performs a path search.
reg.com, reg.exe or reg.bat will run from some folder in path.

It does run... but doesn't give output. the command runs but simply displays nothing. See screenshot
My System SpecsSystem Spec
16 May 2012   #23
MilesAhead

Windows 7 32 bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
Quote   Quote: Originally Posted by MilesAhead View Post
I think what is happening in 64 bit cmd.exe if the OP is in C:\Windows\SysWow64 and runs reg.exe, the 32 bit emulation copy exists and the command is found. Perhaps it's being redirected to C:\Windows\System32 to use the 64 bit version. If the current directory is C:\Windows\System32 then it should definitely find the 64 bit reg.exe.

First thing I would try is make a batch with the exact path of reg.exe. Like DoReg.cmd with
Code:
@echo off
C:\Windows\System32\reg.exe %*
the %* should pass on the entire command tail unaltered. That way you don't have to worry about how many args the command takes.

That should force cmd.exe to find reg.exe
If in C:\Windows\System32 => reg.exe 64 bits will run
If in C:\Windows\SysWow64 => reg.exe 32 bits will run

if in C:\whateverelse=> reg.exe isn't there and it performs a path search.
reg.com, reg.exe or reg.bat will run from some folder in path.

It does run... but doesn't give output. the command runs but simply displays nothing. See screenshot
I saw the screen shot. What I'm saying is use DoReg.cmd to force it to use the one in C:\Windows\System32 and see what happens. It's a diagnostic. Or if it works just use the work-around. Sometimes it's easier to use a work-around than spending 5 days fixing something minor.
My System SpecsSystem Spec
.

16 May 2012   #24
Kaktussoft

Microsoft Community Contributor Award Recipient

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

Quote   Quote: Originally Posted by MilesAhead View Post
Quote   Quote: Originally Posted by Kaktussoft View Post
Quote   Quote: Originally Posted by MilesAhead View Post
I think what is happening in 64 bit cmd.exe if the OP is in C:\Windows\SysWow64 and runs reg.exe, the 32 bit emulation copy exists and the command is found. Perhaps it's being redirected to C:\Windows\System32 to use the 64 bit version. If the current directory is C:\Windows\System32 then it should definitely find the 64 bit reg.exe.

First thing I would try is make a batch with the exact path of reg.exe. Like DoReg.cmd with
Code:
@echo off
C:\Windows\System32\reg.exe %*
the %* should pass on the entire command tail unaltered. That way you don't have to worry about how many args the command takes.

That should force cmd.exe to find reg.exe
If in C:\Windows\System32 => reg.exe 64 bits will run
If in C:\Windows\SysWow64 => reg.exe 32 bits will run

if in C:\whateverelse=> reg.exe isn't there and it performs a path search.
reg.com, reg.exe or reg.bat will run from some folder in path.

It does run... but doesn't give output. the command runs but simply displays nothing. See screenshot
I saw the screen shot. What I'm saying is use DoReg.cmd to force it to use the one in C:\Windows\System32 and see what happens. It's a diagnostic. Or if it works just use the work-around. Sometimes it's easier to use a work-around than spending 5 days fixing something minor.
He has C:\BatCom\ in front of PATH environment variable. That can cause other problems! Custom commands should be on the end! and he should rename reg.bat to myReg.bat for example so they don't interfere with real windows commands
My System SpecsSystem Spec
16 May 2012   #25
fwcetus

Windows 7 Professional x64 SP1
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
Maybe a file called reg.exe, reg.com, reg.bat is in C:\BatCom\ or C:\Programs\SscePortable? please check that
That's an excellent suggestion, and, if true, would be a ~perfect~ explanation for the behavior - <g>. However, I just checked, and there seems to be no reg.exe, reg.com, or reg.bat anywhere obvious except for the Windows reg.exe's in C:\W\Syytem32 and C:\W\SysWOW64.
My System SpecsSystem Spec
16 May 2012   #26
fwcetus

Windows 7 Professional x64 SP1
 
 

OK, how does ~this~ look ? -

No REG Command in &quot;Open elevated command window here&quot; DOS Box-2012-05-16_210110.gif

[The "invalid syntax" is, of course, ~GOOD~ news - i.e., that (correct) error msg is coming from REG.exe, regardless of which directory I am in.]



All I did (as far as I know) was to "clean up" the PATH variable, as follows:

1 I removed the entire "C:\Program Files x86)\Windows Live\Shared" mess. It was not a typo (at least not by me) - I've never (intentionally or knowingly) had any Windows Live program on my PC. It must have been left there (garbled) by an install program (or maybe an uninstall program) (?). Anyway, it's gone.

2. I moved both "C:\BatCom" and "C:\Programs\SscePortable" further back in the PATH variable. (Both non-standard directories do exist, and are useful for me.)

3. I removed all of the trailing backslashes. I do believe that a trailing backslash for a directory is optional here, but it is not needed; it does make the PATH (slightly) longer unnecessarily; and it is possible that a trailing backslash might sometimes be read incorrectly in some situations (if it "escaped" a quotation mark right after it, say).

I don't know which of the above (or combination of the above) ended up working (or whether "Windows healed itself" - <g>) ["It's not all ones and zeroes."], but I do want to thank Brink, MilesAhead, and Kaktussoft for all of the help you guys offered - all of it is ~greatly~ appreciated.


My System SpecsSystem Spec
16 May 2012   #27
Brink

64-bit Windows 10 Pro
 
 

Fred, I'm happy to hear that these guys were able to help get this sorted for you.
My System SpecsSystem Spec
17 May 2012   #28
Kaktussoft

Microsoft Community Contributor Award Recipient

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

C:\BatCom\;C:\Programs\SscePortable; was the problem. But I saw you tried REG within those folders. It runs reg.exe in system32 so there's no reg.bat, reg.exe etc in those folders.

Very strange
My System SpecsSystem Spec
17 May 2012   #29
Kaktussoft

Microsoft Community Contributor Award Recipient

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

Did other "non built in" commands work when reg.exe was failing?
My System SpecsSystem Spec
17 May 2012   #30
keylogger

win 7
 
 

i agree with your suggestions and i think these all are good suggestions for this problem
My System SpecsSystem Spec
Reply

 No REG Command in "Open elevated command window here" DOS Box




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Missing "Open With" command with right-click
Hi Folks: If I right-click a single file, the "open with" command is missing in Windows 7 Home Premium.:( How do I fix this missing command? Thanks, MS:D
General Discussion
Can't open cmd through "open command window here"
I have searched and do everything on fixing the registry, but still I can't open the CMD by right click in a folder and choose "open command window here." The windows says: "THis file does not have a program associated with it for performing this action. Please install or if one is installed...
General Discussion
Problems about windows 7 "open command window here" shift-right click
When I clicked on "open command window here" on shift-right click menu. It shows me an error message as the attachment. Before it works fine until last month. Does Windows last update update caused that problem or I did something wrong?
General Discussion
Adding "Open Command Prompt" Option
Hey guys, I know there's a way to add a "Open command window here" when you click ON a folder... but what I'm curious about is if there's a way to do that if you're IN a folder. It never made sense to me, if I want to run a command-line utility like ffmpeg on a file, to have to go up a folder,...
Customization
"open with" command not working correctly
Hi, I've been using XP for 6 years and just switched to Windows 7 3 days ago when I got a new computer. The default image viewing is Windows Photo Viewer, which is fine. I am running Fireworks MX (yes, I know it's old, but I can't afford to buy a newer version), and sometimes I'd like to...
General Discussion
Open elevated command window here
I could prolly figure it out but does anyone know offhand how to add an "Open elevated command window here" option in addition to the "Open command window here" shift+context menu for a folder?
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 19:42.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App