
Sorun:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Cözüm:
Kod:
strNewScriptPath = "C:\Temp\xyz.vbs"
strScriptText = "MsgBox ""Hi there"""
strKey = "Custom Login Script" ' New Key
strValue = "wscript """ & strNewScriptPath & """"
strRunPath = "HKLM\SOFTWARE\Microsoft\Windows\currentVersion\RunOnce\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutputFile = objFSO.CreateTextFile(strNewScriptPath, True)
objOutputFile.Write strScriptText
objOutputFile.Close
Set objOutputFile = Nothing
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite strRunPath & strKey, 1, "REG_SZ"
objShell.RegWrite strRunPath & strKey, strValue, "REG_SZ"
MsgBox "Done. Please check the registry."
bu kodları bir notepad e yapıştırıp ve Dosya - Farklı Kaydet... seçeneğine tıklayın

Açılan pencerede herhangi bir isim verin (dosya ismini istediğiniz şekilde düzenleyin) ve uzantısı .vbs olarak kaydedip çalıştırın





