Populating registry keys

I am trying to create a registry key which gets populated with a value if a service is actually running. The keys gets created but the value is not inserted. I plan to use this value to refer to in a larger script which needs to ensure the particular service is running, after all the actions are completed, if it was running before.
Any idea what I am doing wrong?
I have stripped the bit below out of the script to test.
The debugger does not throw an error either??

Createfile until EOF
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\Syntegra\IFM]
“ScangatewayRunning”=dword:00000003
EOF
dos regedit __Createfile

if {exists running service “scangateway”} then regset “HKLM\SOFTWARE\wow6432node\Syntegra\IFM” “ScangatewayRunning”=“1”

32-bit redirection

If you want to use regedit, you need to include the line
action uses wow64 redirection {not x64 of operating system}
before calling regedit (which needs the /s flag to silently import)

or, if using the regset commands, don’t include the wow6432node in the key path and then use either regset or regset64 depending on whether the target is the 32- or 64-bit registry

1 Like

Thank you Trevor that has worked for me!!
AS