Code:
alias regwrite {
  .comopen rr WScript.Shell
  if ($prop == key) var %ok $com(rr,RegWrite,3,bstr,$1,int,,bstr,REG_SZ)
  else var %ok $com(rr,RegWrite,1,bstr,$1,bstr,$2,bstr,$iif(!$prop || $prop == string,REG_SZ,REG_DWORD))
  .comclose rr
  return %ok
}

To add a key: $regwrite(<path>).key
<path> must end with a backslash otherwise you're setting a keyvalue

To add a key+value to a key:

add an int: $regwrite(<path>,<number>).int
add a string: $regwrite(<path>,<string>)
This time <path> must not end with a backslash

Example:
//echo -a $regwrite(HKCU\Software\mIRC\test\).key
//echo -a $regwrite(HKCU\Software\mIRC\test\test,5).int
//echo -a $regwrite(HKCU\Software\mIRC\test\test1,test)

https://msdn.microsoft.com/en-us/library/yfdfhz1b(v=vs.84).aspx

Last edited by Wims; 20/02/17 04:14 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel