<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7974&amp;type=atom" />
	<updated>2017-02-26T21:26:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7974</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113354#p113354" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Yurachb пишет:</cite><blockquote><p>но не требуйте учиться, а тем более не осуждайте</p></blockquote></div><p>Я этого и не требовал. А осуждать буду. Подобные коды в разделе &quot;Коллекция скриптов и идей&quot; просто забраковали бы как не подлежащие размещению. Как писать для себя - это ваше личное дело, а для паблика уж лучше постарайтесь выделить пару минут на правку, чтобы не выглядеть белой вороной на фоне других авторов. Это моя к вам просьба на будущее.</p><p><span style="color: green"><strong>Добавлено</strong>: Я уже дал понять, что обсуждать вопросы чужой орфографии тут больше не надо.<br />Сообщение удалено. Не отходите от темы.</span></p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-26T21:26:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113354#p113354</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113353#p113353" />
			<content type="html"><![CDATA[<p>\</p>]]></content>
			<author>
				<name><![CDATA[Yurachb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27379</uri>
			</author>
			<updated>2017-02-26T21:17:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113353#p113353</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113352#p113352" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Yurachb пишет:</cite><blockquote><p>А обвинять в исправлении ошибок, так что, теперь всё будет с ног на голову? Исправление это зло, пусть с ошибкой живёт, порок это то, к чему мы будем стремиться?</p></blockquote></div><p>Что будет с ног на голову? Какой ещё порок? Человек предложил своё решение на js. Высказал своё мнение. Ошибки смысл никак не исказили. Всё это произошло далеко не вчера, но вы не постеснялись спустя столько времени за такую ерунду тут зацепиться. Это флуд. Он к теме отношения не имеет. Выложили свои коды, всё, на этом нужно было остановиться. А теперь ещё развели бессмысленную демагогию. <span style="color: green">Всё, на этом стоп. Пишу уже как модератор.</span></p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-26T21:11:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113352#p113352</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113351#p113351" />
			<content type="html"><![CDATA[<p><strong>Yurachb</strong><br />Не путайте js-код, особенно браузерный, с vbs-кодом. Нравится вам или нет, но существует этикет написания публичных кодов для удобочитаемости. Ранее кому-то уже сбрасывал <a href="http://gsbelarus.com/gs/wiki/index.php/%D0%A4%D0%BE%D1%80%D0%BC%D0%B0%D1%82_%D0%B8%D1%81%D1%85%D0%BE%D0%B4%D0%BD%D0%BE%D0%B3%D0%BE_%D0%BA%D0%BE%D0%B4%D0%B0_%D0%BD%D0%B0_VBScript">эту страницу</a>. Пробелы не являются мусором ровно как и после пунктуации в русском языке. Компактностью у вас и не пахнет. Вот как можно записать ваши коды:<br /></p><div class="codebox"><pre><code>For Each Pr in GetObject(&quot;winmgmts:&quot;).ExecQuery(&quot;Select * from Win32_Process Where Name=&#039;regedit.exe -m&#039;&quot;)
	Pr.Terminate
Next
With CreateObject(&quot;WScript.Shell&quot;)
	.RegWrite &quot;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey&quot;,_
	&quot;HKEY_CURRENT_USER\Software\KMPlayer\KMP2.0\LastPosition&quot;,&quot;REG_SZ&quot; : .Run &quot;regedit -m&quot;
End With</code></pre></div><div class="codebox"><pre><code>For Each Pr in GetObject(&quot;winmgmts:&quot;).ExecQuery(&quot;Select * from Win32_Process Where Name=&#039;regedit.exe -m&#039;&quot;)
	Pr.Terminate
Next
OpenKey = Inputbox(&quot;   ВВЕДИТЕ АДРЕС РАЗДЕЛА РЕЕСТРА&quot; &amp; chr(10) &amp; &quot;   !!! Там будьте предельно осторожны !!!&quot;)
With CreateObject(&quot;WScript.Shell&quot;)
	If OpenKey = 1 Then .RegWrite &quot;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey&quot;,_
	OpenKey, &quot;REG_SZ&quot; : .Run &quot;regedit -m&quot;
End With</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-26T20:59:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113351#p113351</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113350#p113350" />
			<content type="html"><![CDATA[<p>\</p>]]></content>
			<author>
				<name><![CDATA[Yurachb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27379</uri>
			</author>
			<updated>2017-02-26T20:30:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113350#p113350</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113347#p113347" />
			<content type="html"><![CDATA[<p><strong>Yurachb</strong><br />Как говорится, &quot;с кусаниями придёшь, от кусаний и ...&quot;. Никакие &quot;ради себя&quot; тут не нужны.<br />Чтобы оформить коды как полагается (с пробелами, отступами и переводами строк), асом быть не нужно. Но вам почему-то приспичило показать себя асом в орфографии.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-26T20:01:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113347#p113347</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113346#p113346" />
			<content type="html"><![CDATA[<p>\</p>]]></content>
			<author>
				<name><![CDATA[Yurachb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27379</uri>
			</author>
			<updated>2017-02-26T19:45:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113346#p113346</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113345#p113345" />
			<content type="html"><![CDATA[<p><strong>Yurachb</strong><br />Вместо того, чтобы искать ошибки в тексте сообщений двухлетней давности, что в данной ситуации кроме как на флуд ни на что не тянет, лучше бы взяли с местных авторов пример в части оформления VBS-кода.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2017-02-26T19:18:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113345#p113345</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113344#p113344" />
			<content type="html"><![CDATA[<p>\</p>]]></content>
			<author>
				<name><![CDATA[Yurachb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27379</uri>
			</author>
			<updated>2017-02-26T19:01:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113344#p113344</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=113337#p113337" />
			<content type="html"><![CDATA[<p>\</p>]]></content>
			<author>
				<name><![CDATA[Yurachb]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27379</uri>
			</author>
			<updated>2017-02-26T18:01:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=113337#p113337</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93652#p93652" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>mozers пишет:</cite><blockquote><p>Чесноговоря смысла запуска под пользователем особо не понимаю.</p></blockquote></div><p>Почти никогда не вхожу в систему под учётной записью с правами администратора, при необходимости запуская от её имени те или иные программы.</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2015-04-27T17:27:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93652#p93652</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93636#p93636" />
			<content type="html"><![CDATA[<p>Добавлю до кучи <a href="https://bitbucket.org/html-applications/script/src/default/RegJump.js">свой вариант</a>.<br />Принимает ключ и из ком.строки и из буфера обмена. Поэтому он у меня подключен к <a href="http://scite-ru.bitbucket.org/">SciTE</a> чтобы открывать выделенный в редакторе ключ. А если я скопировал (откуда то) ключ в буфер, то просто щелкаю по иконке скрипта.<br />Чесноговоря смысла запуска под пользователем особо не понимаю. Админ и так видит (и может редактировать, в отличии от зачастую бесправного пользователя) ветки всех пользователей данного ПК.</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2015-04-27T09:23:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93636#p93636</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92977#p92977" />
			<content type="html"><![CDATA[<p>Что касается проблемы кавычек, то решается сопоставлением текущего процесса с данными из WMI. Так, по идентификатору процесса получаем полную командную строку.</p>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2015-04-03T12:01:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92977#p92977</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92974#p92974" />
			<content type="html"><![CDATA[<p>Хотел было опубликовать в коллекцию, но вовремя нашел эту тему.</p><p><strong>VBScript: открытие редактора реестра на заданном ключе, RegJump</strong></p><div class="codebox"><pre><code>&#039; Поставляемая часть {

Class classObjects
    Public WSShell
    Public RegExp

    Private Sub Class_Initialize
        Set WSShell = WScript.CreateObject(&quot;Wscript.Shell&quot;)
        Set RegExp = CreateObject(&quot;VBScript.RegExp&quot;)
    End Sub

End Class

Function RegJump(Objects, Key, WaitForReturn)
    Objects.RegExp.Pattern = &quot;^HKLM\\&quot;
    Key = Objects.RegExp.Replace(Key, &quot;HKEY_LOCAL_MACHINE\&quot;)
    
    Objects.RegExp.Pattern = &quot;^HKCU\\&quot;
    Key = Objects.RegExp.Replace(Key, &quot;HKEY_CURRENT_USER\&quot;)
    
    Objects.RegExp.Pattern = &quot;^HKCR\\&quot;
    Key = Objects.RegExp.Replace(Key, &quot;HKEY_CLASSES_ROOT\&quot;)
    
    Objects.RegExp.Pattern = &quot;^HKU\\&quot;
    Key = Objects.RegExp.Replace(Key, &quot;HKEY_USERS\&quot;)

    Objects.RegExp.Pattern = &quot;^HCC\\&quot;
    Key = Objects.RegExp.Replace(Key, &quot;HKEY_CURRENT_CONFIG\&quot;)

    Objects.RegExp.Pattern = &quot;\\\\&quot;
    Key = Objects.RegExp.Replace(Key, &quot;\&quot;)
    
    LastKey = &quot;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey&quot;
    LastValue = Objects.WSShell.RegRead(LastKey)
    
    Objects.RegExp.Pattern = &quot;\\.+&quot;
    HostName = Objects.RegExp.Replace(LastValue, &quot;&quot;)
    Key = HostName &amp; &quot;\&quot; &amp; Key
    
    Call Objects.WSShell.RegWrite(LastKey, Key, &quot;REG_SZ&quot;)
    RegJump = Objects.WSShell.Run(&quot;regedit /m&quot;, 1, WaitForReturn)
End Function

&#039; } Поставляемая часть

&#039; Пример {

Sub Main()
    Set Objects = New classObjects
    
    &#039;Чтение первого параметра
    Key = &quot;&quot;
    Set Arguments = WScript.Arguments
    If Arguments.Count &gt; 0 Then
        Key = Arguments(0)
    End If
    If Key = &quot;&quot; Then
        Call MsgBox(&quot;Example:&quot; &amp; vbCrLf &amp; WScript.ScriptName &amp; &quot; HKCU\Software\Microsoft&quot;, , &quot;Parameter 1 is required&quot;)
        Exit Sub
    End If
    
    Call RegJump(Objects, Key, True)
End Sub

Call Main()

&#039; } Пример</code></pre></div><p>За основу был взят <a href="https://searchcode.com/codesearch/view/7983168/">скрипт на JS</a>.<br />Но я решил что убивать процесс - бесчеловечно, поэтому нашел ключ /m.<br />На w7 без UAC работает.</p><p><strong>Todo</strong>:<br />- Проверить как будет работать если в пути к ветке реестра будут пробелы.</p><p><strong>См. также</strong>:<br />Аналогичные темы на сером форуме по данной задаче на других языках (найдены поиском по &quot;CurrentVersion\Applets\Regedit\Lastkey&quot;, также как и эта):<br /><a href="http://forum.script-coding.com/viewtopic.php?id=291">Коллекция скриптов и идей → WSH: автом. позиционирование в окне Regedit.exe на нужном параметре</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=6462">Общение → JScript: переход в указанный раздел реестра</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=5785">Общение → AHK: Навигация в редакторе реестра regedit.exe</a></p>]]></content>
			<author>
				<name><![CDATA[Kiber]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=262</uri>
			</author>
			<updated>2015-04-03T11:28:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92974#p92974</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Запуск REGEDIT.EXE на заданном разделе реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=68591#p68591" />
			<content type="html"><![CDATA[<p>Нет, в меню с шифтом присутствует пункт &quot;Запуск от имени другого пользователя&quot;.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2013-01-17T04:53:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=68591#p68591</id>
		</entry>
</feed>
