Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the methods of operating bat and registry

Shulou Source: shulou.com Published: 2022-06-03 09:15:34 09月24日 Update

This article mainly explains "bat and registry operation methods," interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "bat and registry operation methods have what" bar!

bat(batch processing) operation registry method, I know there should be two kinds

1, combined with reg.exe to achieve reading and writing registry

2, use bat output file, and then regedit /s 1.reg format to achieve output vbs and so on are this

echo cmd.exe /k dir c: > c:\windows\system32\1.bat

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "test" /d "c:\windows\system32\1.bat" /f

command prompt

reg /?

Look at the help.

I'll help you stick it up about reg add. See for yourself.

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

KeyName [\\Machine\]FullKey

Machine name of remote machine-Ignore default to current machine.

Only HKLM and HKU are available on remote machines.

FullKey ROOTKEY\SubKey

ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]

The full name of the registry entry under ROOTKEY selected by SubKey

/v Name of value to add under selected item

/ve Add a blank value name to a registry key

/t RegKey Data Type

[ REG_SZ | REG_MULTI_SZ | REG_DWORD_BIG_ENDIAN |

REG_DWORD | REG_BINARY | REG_DWORD_LITTLE_ENDIAN |

REG_NONE | REG_EXPAND_SZ ]

If omitted, use REG_SZ

/s specifies one in the REG_MULTI_SZ data string

Character used as separator

If omitted, use '\0' as separator

/d Data to assign to registry ValueName added

/f Force overwrite existing registry key without prompting

For example:

REG ADD \\ABC\HKLM\Software\MyCo

Add a registry key HKLM\Software\MyCo on remote machine ABC

REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead

Add a value (name: Data, type: REG_BINARY, data: fe340ead)

REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail

Add a value (Name: MRU, Type: REG_MUTLI_SZ, Data: fax\0mail\0\0)

REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%%

Add a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%)

Note: Use double percent sign ( %% ) in extended strings

At this point, I believe that we have a deeper understanding of "bat and registry operation methods," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: Registry data method machine type name character content delimiter string learning prompt output practical deeper no use interest only command Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Docker Shulou Technology Redmi