Target OS: Windows 10 X64.
Hi,
I came across an odd issue using PrimalScript 2015 Ver 7.1.67.0 on Windows 10 X64 bit OS. As an example, I compiled the below VBscript as a WSH X64 in script packager (last selectable option in script packager). When I run the compiled exe, it does not create the Registry Key “My_Test_Key”.
I then went back into script packager and change the manifest from “embed a default manifest” to “embed a default manifest for elevation”. Now, when I double click the compiled exe, the Registry key, “My_Test_Key” is added to the registry. So far so good.
Now, when point the compiled exe from the registry runKey (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run) It does not execute the script after a reboot. If I revert the manifest to “embed a default manifest” the compiled script launches from the registry RunKey BUT does not add the “My_Test_Key”.
I need for the compiled exe to run form the runkey and add the registry key “My_Test_Key”. I spent almost two days and can’t figure this out. ANY help of suggestion will be grateful.
Thanks in advance.
VBScript Code
Double-click the code block to select all.Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER = &H80000001 Wscript.echo "Start" Set objNetwork = CreateObject("WScript.Network") strComputer = objNetwork.ComputerName Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") Test = "SOFTWARE\My_Test_Key" oReg.CreateKey HKEY_LOCAL_MACHINE, Test Wscript.echo "Done"