0
I've been trying to run a VBScript file every time my system starts up, and have tried modifying the registry using VBScript to add it to the list of programs to run, but I'm facing a problem with permissions even though I'm the computers administrator. I'm trying to add VB_Start.vbs
to the list of startup tasks by modifying the registry with the following VBScript code:
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Visual Basic" , "VB_Start.vbs" , "REG_SZ"
Set WshShell = Nothing
When I execute this code I'm getting the following error:
Error: Invalid root in registry key HKEY_LOCAL_MACHINE\SOFTWARE\......
Error Code: 80070005
Source: WshShell.RegWrite