How to use the reg command line statement


  1. Posts : 892
    Windows 7 x64 Ultimate
       #1

    How to use the reg command line statement


    There is a small batch file I would like to execute. I have cut and pasted it from another source.
    The batch file failed repeatedly.

    Then I attempted to run the statements individually at the command prompt.
    Things still failed.

    Example:

    reg load HKLM\MY_SYSTEM followed by a command in " " marks needs my machine name which is msi64-PC. The machine description is msi64.

    But the statement bombs and says pretty much it can't find any part of the statement that is correct.

    I can copy out the exact error if needed. But the problem seems to be I'm not pointing at the right thing in the first place or there is a directory conflict.

    The sequence is

    reg load MY_SYSTEM followed by " a command statement to "0Windows\System32\config\system" in quotes

    reg delete followed by what to delete

    reg unload which is MY_SYSTEM (to get out of the command)

    All of these fail.

    I should be able to run the load command at least with no argument from Win7

    that statement from the sample looks like this:

    reg load HKLM\MY_SYSTEM "%~dp0 (zero)Windows\System32\config\system"

    I can add the error at a follow up
      My Computer


  2. Posts : 3,487
    Win 7 Pro x64/Win 10 Pro x64 dual boot
       #2

    It might be better if you post the batch file so that we can actually see the syntax and then maybe we can tell what's going on.
      My Computer


  3. Posts : 892
    Windows 7 x64 Ultimate
    Thread Starter
       #3

    I'm concerned about the content. Don't want to break any rules here.

    The first line should be able to be run error free. Can you do that and maybe post a screen shot?

    Whenever I see tildes and percent signs I think something is truncated and incomplete.
    Are these legitimate characters would be a start.
      My Computer


  4. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #4

    Add a pause command as the last statement in your BAT file.
    That will keep the CMD window open so you can upload a screen print of the error you see into your SF post.

    From the OP, I wonder why your "0Windows\System32\config\system" statement has the 0 in Windows,
    maybe that should just be "Windows\System32\config\system"

    Are you sure the source you copied this batch file from is reliable and trustworthy ?
      My Computer


  5. Posts : 892
    Windows 7 x64 Ultimate
    Thread Starter
       #5

    If the Oh or Zero in the statement looks like an error I can certain hand enter it
    without and see what happens. It's on the original work.

    I will get you the screen shot or text of the error tomorrow is the soonest.
    This is no big emergency.

    Any entry I make should have _what_ at the MY_SYSTEM statement? I still don't know
    what the author of the .bat meant.
      My Computer


  6. Posts : 892
    Windows 7 x64 Ultimate
    Thread Starter
       #6

    The batch file with errors is shown in the attachment. Moderators can say if it violates any rules. The purpose of the bat file is reset the ability to rearm Win7.

    A certain number of rearm commands as in SLMGR -REARM are allowed after which an error issues.

    Just now I noticed some strange character at the command screen in the first line. The first line and naming conventions of what was the generic MY_SYSTEM given in the original and described earlier above have the errors.

    Lastly if Win7 has a tutorial on the rearm problem and it has been addressed already, please advise.
    Attached Thumbnails Attached Thumbnails How to use the reg command line statement-batch-file-sample-7-forums.gif  
      My Computer


 

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