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

Page 4 of 4 FirstFirst ... 234

  1. Posts : 24
    Windows 7 Professional x64 SP1
    Thread Starter
       #31

    Kaktussoft said:
    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 Computer


  2. Posts : 24
    Windows 7 Professional x64 SP1
    Thread Starter
       #32

    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 Computer


  3. Posts : 24
    Windows 7 Professional x64 SP1
    Thread Starter
       #33

    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.
    Last edited by Brink; 17 May 2012 at 14:22. Reason: code box
      My Computer


  4. Posts : 5,092
    Windows 7 32 bit
       #34

    Kaktussoft said:
    MilesAhead said:
    Kaktussoft said:
    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 Computer


 
Page 4 of 4 FirstFirst ... 234

  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 18:33.
Find Us