M
M
mercy_smile2021-03-15 12:08:18
C++ / C#
mercy_smile, 2021-03-15 12:08:18

Why is the value not being added to the registry?

void Utils::Autoload(string Name , string Path ) {
  string command = "REG ADD \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /V " + Name + " /t REG_SZ /F /D " + Path;
  system(command.c_str());

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2021-03-15
@jcmvbkbc

HKCU\\HKEY_LOCAL_MACHINE

It's kind of a strange combination. Must be either HKCU or HKLM, but not one under the other. Judging by the full name of the key, it should start with "HKLM\\SOFTWARE\\Microsoft…".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question