I need to write to a key in HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers eventually the code will look like this
While 1 $msg2 = GUICtrlRead($Account) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Lexmark Universal v2 XL\PrinterDriverData", "AccountTrackAccountNumber", "REG_SZ", $msg2) WEnd
but right now i am just trying to get reg write to work under hklm I hope I am diong something obviously stupid
this is what I am testing with
#RequireAdmin DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) RegWrite("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers", "test2", "REG_sz", "Hello this is a test2") RegWrite("HKCU\Software\Test", "TestKey2", "REG_SZ", "Hello this is a test2") MsgBox(0, "", @error)
ive added the first two lines after reading the forum it still returns a 0 error. Ive stopped the print spooler, tried various locations HKLM as well as HKCC. I can write to HKCU just fine but i change two letters and it doesn't work. my personal user is an admin and "the" administrator account is active. Ive tried it under both. I've tried hklm and hklm64. importing from a reg works fine the admin group has full control over the key. I really don't think using reg add will do what I need since i need a variable in the function, ive tried new keys as well as existing keys. is there some kind of force overwrite?