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

17 May 2012   #31
fwcetus

Windows 7 Professional x64 SP1
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
Did other "non built in" commands work when reg.exe was failing?
Yes, as far as I could tell. REG seemed ti be the only problem. I have no specific information as to why "cleaning up" the PATH would "free up" REG but leave everything else unaffected (positively or negatively) Oh, well...

In any event, now everything works OK (as far as I can tell) (and until something else goes wrong - <g>).


My System SpecsSystem Spec
.
17 May 2012   #32
fwcetus

Windows 7 Professional x64 SP1
 
 

I tried one more little experiment -

I changed the lines in the context menu menu item that say -

@="cmd.exe /s /k pushd \"%V\"

- so as to say -

@="C:\\Windows\\System32\\cmd.exe /s /k \"pushd %V\""

- in order to try to force the System32 version of cmd.exe to be invoked.

If I launched the CMD box from Explorer (a 64-bit app) it worked (but it would have done so anyways, even before my change).

However, if I launched it from PowerDesk (a 32-bit app), the 32-bit Windows redirection caused the SysWOW64 version of cmd.exe to came up.

The good news is that both work just fine, so that, even if my little experiment today was a failure, at least REG will work either way.

No REG Command in &quot;Open elevated command window here&quot; DOS Box-2012-05-17_123859.gifNo REG Command in &quot;Open elevated command window here&quot; DOS Box-2012-05-17_120833.gif

And thanks again for everyone's help !!!


My System SpecsSystem Spec
17 May 2012   #33
fwcetus

Windows 7 Professional x64 SP1
 
 

Not being one that likes to leave enuf alone, I changed that original line from -

@="cmd.exe /s /k pushd \"%V\"

- so as to say -

@="cmd.exe /s /k \"pushd %V && title Elevated Command Prompt\""

This changes the title bar of the CMD window, as -

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

Of course, I usually run the above commands as part of an elevated privilege batch file -

Code:
 
@echo off
rem RegBackup.BAT backs up the Registry hives to %SystemRoot%\RegBackup\
rem the following command Will usually (but not always) cause the following error -
rem REG SAVE HKLM\COMPONENTS %SystemRoot%\RegBackup\COMPONENTS
rem ERROR: The system was unable to find the specified registry key or value.
cls
echo.
if exist %SystemRoot%\RegBackup\COMPONENTS.OLD del %SystemRoot%\RegBackup\COMPONENTS.OLD
if exist %SystemRoot%\RegBackup\HARDWARE.OLD del %SystemRoot%\RegBackup\HARDWARE.OLD
if exist %SystemRoot%\RegBackup\SAM.OLD del %SystemRoot%\RegBackup\SAM.OLD
if exist %SystemRoot%\RegBackup\SECURITY.OLD del %SystemRoot%\RegBackup\SECURITY.OLD
if exist %SystemRoot%\RegBackup\SOFTWARE.OLD del %SystemRoot%\RegBackup\SOFTWARE.OLD
if exist %SystemRoot%\RegBackup\SYSTEM.OLD del %SystemRoot%\RegBackup\SYSTEM.OLD
if exist %SystemRoot%\RegBackup\NTUSER.DAT.OLD del %SystemRoot%\RegBackup\NTUSER.DAT.OLD
if exist %SystemRoot%\RegBackup\COMPONENTS.BAK ren %SystemRoot%\RegBackup\COMPONENTS.BAK COMPONENTS.OLD
if exist %SystemRoot%\RegBackup\HARDWARE.BAK ren %SystemRoot%\RegBackup\HARDWARE.BAK HARDWARE.OLD
if exist %SystemRoot%\RegBackup\SAM.BAK ren %SystemRoot%\RegBackup\SAM.BAK SAM.OLD
if exist %SystemRoot%\RegBackup\SECURITY.BAK ren %SystemRoot%\RegBackup\SECURITY.BAK SECURITY.OLD
if exist %SystemRoot%\RegBackup\SOFTWARE.BAK ren %SystemRoot%\RegBackup\SOFTWARE.BAK SOFTWARE.OLD
if exist %SystemRoot%\RegBackup\SYSTEM.BAK ren %SystemRoot%\RegBackup\SYSTEM.BAK SYSTEM.OLD
if exist %SystemRoot%\RegBackup\NTUSER.DAT.BAK ren %SystemRoot%\RegBackup\NTUSER.DAT.BAK NTUSER.DAT.OLD
if exist %SystemRoot%\RegBackup\COMPONENTS ren %SystemRoot%\RegBackup\COMPONENTS COMPONENTS.BAK
if exist %SystemRoot%\RegBackup\HARDWARE ren %SystemRoot%\RegBackup\HARDWARE HARDWARE.BAK
if exist %SystemRoot%\RegBackup\SAM ren %SystemRoot%\RegBackup\SAM SAM.BAK
if exist %SystemRoot%\RegBackup\SECURITY ren %SystemRoot%\RegBackup\SECURITY SECURITY.BAK
if exist %SystemRoot%\RegBackup\SOFTWARE ren %SystemRoot%\RegBackup\SOFTWARE SOFTWARE.BAK
if exist %SystemRoot%\RegBackup\SYSTEM ren %SystemRoot%\RegBackup\SYSTEM SYSTEM.BAK
if exist %SystemRoot%\RegBackup\NTUSER.DAT ren %SystemRoot%\RegBackup\NTUSER.DAT NTUSER.DAT.BAK
echo Backing up the Registry hives . . .
echo.
echo Backing up COMPONENTS . . .
REG SAVE HKLM\COMPONENTS %SystemRoot%\RegBackup\COMPONENTS
echo.
echo Backing up HARDWARE . . .
REG SAVE HKLM\HARDWARE %SystemRoot%\RegBackup\HARDWARE
echo.
echo Backing up SAM . . .
REG SAVE HKLM\SAM %SystemRoot%\RegBackup\SAM
echo.
echo Backing up SECURITY . . .
REG SAVE HKLM\SECURITY %SystemRoot%\RegBackup\SECURITY
echo.
echo Backing up SOFTWARE . . .
REG SAVE HKLM\SOFTWARE %SystemRoot%\RegBackup\SOFTWARE
echo.
echo Backing up SYSTEM . . .
REG SAVE HKLM\SYSTEM %SystemRoot%\RegBackup\SYSTEM
echo.
echo Backing up HKCU . . .
REG SAVE HKCU %SystemRoot%\RegBackup\NTUSER.DAT
echo.


My System SpecsSystem Spec
.

17 May 2012   #34
MilesAhead

Windows 7 32 bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
Quote   Quote: Originally Posted by MilesAhead View Post
Quote   Quote: Originally Posted by Kaktussoft View Post
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
I grokk that. But PATH doesn't come into play if you specify the exact file. That's the diagnostic. If the batch worked then it would prove your theory instead of just making changes on assumptions.

Generally I agree the batch folder should be last in search order if one is too lazy to search and make sure the batch commands are either unique, or not in the path at all. If required to specify explicitly then you eliminate conflicts. I do Everything Search whenever I make a batch file and often use a "Do" prefix to avoid name conflicts.
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 21:39.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App