1
I would like to know how to add the name of the user where it is in quotes written "I must put the name of the user here"
#include "stdafx.h"
#include<iostream>
#include<Windows.h>
#include<lmcons.h>
using namespace std;
int main() {
//User Name
TCHAR username[UNLEN + 1];
DWORD username_len = UNLEN + 1;
GetUserName((TCHAR*)username, &username_len);
wcout << username << endl;
//Computer name
TCHAR compname[UNCLEN + 1];
DWORD compname_len = UNCLEN + 1;
GetComputerName((TCHAR*)compname, &compname_len);
wcout << compname << endl;
cin.get();
system("reg add HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /t REG_SZ /v formula /d C://users//"DEVO COLOCAR O NOME DO USUARIO AQUI"//downloads//formula.exe");
return EXIT_SUCCESS;
}