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: How to use the reg command line statement

12 Mar 2016   #1

Windows 7 x64 Ultimate
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.


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 System SpecsSystem Spec
12 Mar 2016   #2
Mellon Head

Win 7 Pro x64/Win 10 Pro x64 dual boot

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 System SpecsSystem Spec
12 Mar 2016   #3

Windows 7 x64 Ultimate

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 System SpecsSystem Spec

12 Mar 2016   #4

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM

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 System SpecsSystem Spec
12 Mar 2016   #5

Windows 7 x64 Ultimate

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 System SpecsSystem Spec
13 Mar 2016   #6

Windows 7 x64 Ultimate

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
How to use the reg command line statement-batch-file-sample-7-forums.gif  
My System SpecsSystem Spec

 How to use the reg command line statement

Thread Tools

Similar help and support threads
Thread Forum
Executing command line command anywhere ?
I want to create a setup whereas a command line command can be run from any directory/folder, without having to be in the directory/folder whereas the command line command resides ?
General Discussion
Command Line - Help
Hi Guy's and Girls, Just first off I've never been too good with CMD and only an Apprentice in my company I work for. Now something I've wanted to do for awhile was to make the following but I don't necassirealy I know how to do this in one batch file: I would need a Batch file that is...
General Discussion
UAC bug with runas from command line?
Hi Folks, I am experiencing what I believe is a bug with UAC in Windows 7. I would like to see if anyone can recreate this issue and tell me if it is a bug or is working as expected. To recreate the issue: 1. Confirm the following local security policy setting is Enabled. Local Policies...
General Discussion
How can I set this via command-line or registry?
How can I set this via command-line or registry? I need a way to automatically launch "Explorer c:\folder\myfolder" with a view appropriate for long filenames on any Windows Vista/Win7 PC.
Command Line
Is there a cmd.exe /switch for “run as administrator” ? Thanks-
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:30.
Twitter Facebook Google+