еще вариант:
Код:
![Выделить весь код](images/misc/selectcode.png)
$sPath = "Мой компьютер\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer"
RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit", "Lastkey", "REG_SZ", $sPath)
If ProcessExists ("regedit.exe") Then
ProcessClose("regedit.exe")
If ProcessWaitClose("regedit.exe",3)=0 Then Exit MsgBox(16, "Timeout error", "Regedit not responding.")
EndIf
Run("regedit.exe", @WindowsDir)