{"id":160,"date":"2008-12-17T22:00:00","date_gmt":"2008-12-17T02:00:00","guid":{"rendered":""},"modified":"2013-11-22T20:44:09","modified_gmt":"2013-11-22T12:44:09","slug":"%e5%bc%803389%e6%89%b9%e5%a4%84%e7%90%86%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/160.html","title":{"rendered":"\u5f003389\u6279\u5904\u7406\u4ee3\u7801"},"content":{"rendered":"<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n@echo off\r\ncls\r\n:index\r\ntitle \u5f00\u542f3389\u6279\u5904\u7406\u5de5\u5177\r\ncolor B\r\ncls\r\necho                     \u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\r\necho   \u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524           \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\r\necho   \u2502                \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f                \u2502\r\necho   \u2502                            \u226epyc\u5f00\u542f\u7cfb\u7edf\u7ec8\u7aef\u226f                          \u2502\r\necho   \u2502                                                                      \u2502\r\necho   \u2502    A.\u67e5\u770b\u5f53\u524d\u7cfb\u7edf B.\u5f00\u542fXP,2003\u7ec8\u7aef\u670d\u52a1 C.\u5f00\u542fwindow 2000\u7ec8\u7aef\u670d\u52a1 \u2502\r\necho   \u2502                                                                      \u2502\r\necho   \u2502    D.\u7ec8\u7aef\u7aef\u53e3\u4fee\u6539        R.\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a       Q.\u9000\u51fa\u6279\u5904\u7406         \u2502\r\necho   \u2502                                                                      \u2502\r\necho   \u2502                                                                      \u2502\r\necho   \u2502                                                                      \u2502\r\necho   \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\r\necho.\r\nset start=\r\nset \/p start=    \u8bf7\u9009\u62e9:\r\nif &quot;%start%&quot;==&quot;a&quot; goto ck\r\nif &quot;%start%&quot;==&quot;b&quot; goto xp\r\nif &quot;%start%&quot;==&quot;c&quot; goto 20\r\nif &quot;%start%&quot;==&quot;d&quot; goto xg\r\nif &quot;%start%&quot;==&quot;e&quot; goto cq\r\nif \/i &quot;%start%&quot;==&quot;q&quot; goto end\r\ngoto index\r\n:ck\r\nset a=&quot;XP&quot;\r\nset b=&quot;server 2003&quot;\r\nset d=&quot;WINNT&quot;\r\ntype c:\\boot.ini|findstr %a%&gt;nul&amp;&amp;echo \u5f53\u524d\u64cd\u4f5c\u4e3aXP\u7cfb\u7edf\r\ntype c:\\boot.ini|findstr %b%&gt;nul&amp;&amp;echo \u5f53\u524d\u64cd\u4f5c\u4e3a2003\u7cfb\u7edf\r\ndir c:\\|find %d%&gt;nul&amp;&amp;echo \u5f53\u524d\u64cd\u4f5c\u4e3a2000\u7cfb\u7edf\r\npause\r\ngoto index\r\n:xp\r\nif exist &quot;c:\\shit.reg&quot; (del c:\\shit.reg\r\necho Windows Registry Editor Version 5.00&gt;&gt;c:\\shit.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server]&gt;&gt;c:\\shit.reg\r\necho &quot;fDenyTSConnections&quot;=dword:00000000&gt;&gt;c:\\shit.reg\r\nregedit \/s c:\\shit.reg\r\nsc config TermService start= demand\r\nsc start TermService\r\ndel c:\\shit.reg\r\n)\r\necho Windows Registry Editor Version 5.00&gt;&gt;c:\\shit.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server]&gt;&gt;c:\\shit.reg\r\necho &quot;fDenyTSConnections&quot;=dword:00000000&gt;&gt;c:\\shit.reg\r\nregedit \/s c:\\shit.reg\r\nsc config TermService start= demand\r\nsc start TermService\r\ndel c:\\shit.reg\r\npause\r\ngoto index\r\n:20\r\nif exist &quot;c:\\shift.reg&quot; (del c:\\shift.reg\r\necho Windows Registry Editor Version 5.00 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\netcache] &gt;&gt;c:\\shift.reg\r\necho &quot;Enabled&quot;=&quot;0&quot; &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon]&gt;&gt;c:\\shift.reg\r\necho &quot;ShutdownWithoutLogon&quot;=&quot;0&quot; &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer] &gt;&gt;c:\\shift.reg\r\necho &quot;EnableAdminTSRemote&quot;=dword:00000001 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server] &gt;&gt;c:\\shift.reg\r\necho &quot;TSEnabled&quot;=dword:00000001 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TermDD] &gt;&gt;c:\\shift.reg\r\necho &quot;Start&quot;=dword:00000002 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TermService] &gt;&gt;c:\\shift.reg\r\necho &quot;Start&quot;=dword:00000002 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_USERS\\.DEFAULT\\Keyboard Layout\\Toggle] &gt;&gt;c:\\shift.reg\r\necho &quot;Hotkey&quot;=&quot;1&quot; &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\Wds\\rdpwd\\Tds\\tcp] &gt;&gt;c:\\shift.reg\r\necho &quot;PortNumber&quot;=dword:00000D3D &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp] &gt;&gt;c:\\shift.reg\r\necho &quot;PortNumber&quot;=dword:00000D3D &gt;&gt;c:\\shift.reg\r\nregedit \/s c:\\shift.reg\r\nsc config TermService start= demand\r\nsc start TermService\r\n)\r\necho Windows Registry Editor Version 5.00 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\netcache] &gt;&gt;c:\\shift.reg\r\necho &quot;Enabled&quot;=&quot;0&quot; &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon] &gt;&gt;c:\\shift.reg\r\necho &quot;ShutdownWithoutLogon&quot;=&quot;0&quot; &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer] &gt;&gt;c:\\shift.reg\r\necho &quot;EnableAdminTSRemote&quot;=dword:00000001 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server] &gt;&gt;c:\\shift.reg\r\necho &quot;TSEnabled&quot;=dword:00000001 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TermDD] &gt;&gt;c:\\shift.reg\r\necho &quot;Start&quot;=dword:00000002 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TermService] &gt;&gt;c:\\shift.reg\r\necho &quot;Start&quot;=dword:00000002 &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_USERS\\.DEFAULT\\Keyboard Layout\\Toggle] &gt;&gt;c:\\shift.reg\r\necho &quot;Hotkey&quot;=&quot;1&quot; &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\Wds\\rdpwd\\Tds\\tcp] &gt;&gt;c:\\shift.reg\r\necho &quot;PortNumber&quot;=dword:00000D3D &gt;&gt;c:\\shift.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp] &gt;&gt;c:\\shift.reg\r\necho &quot;PortNumber&quot;=dword:00000D3D &gt;&gt;c:\\shift.reg\r\nregedit \/s c:\\shift.reg\r\nsc config TermService start= demand\r\nsc start TermService\r\ndel c:\\shift.reg\r\npause\r\ngoto index\r\n:xg\r\nset \/p \u6e90\u6570=    \u4fee\u6539\u7ec8\u7aef\u7aef\u53e3\u53f7\u4e3a:\r\nset \/a \u6e90\u6570=%\u6e90\u6570% || goto :eof\r\n:dosomething\r\nset \/a \u4f59\u6570 = %\u6e90\u6570% %% 16\r\nset \/a \u6e90\u6570 \/= 16\r\ncall :\u8f6c\u6362 %\u4f59\u6570%\r\nset \u4f59\u6570=%ret%\r\nset \u8ba1\u7b97\u7ed3\u679c=%\u4f59\u6570%%\u8ba1\u7b97\u7ed3\u679c%\r\nif %\u6e90\u6570% lss 16 goto end\r\ngoto dosomething\r\n:\u8f6c\u6362\r\nset ret=\r\nif &quot;%1&quot; == &quot;10&quot; set ret=A\r\nif &quot;%1&quot; == &quot;11&quot; set ret=B\r\nif &quot;%1&quot; == &quot;12&quot; set ret=C\r\nif &quot;%1&quot; == &quot;13&quot; set ret=D\r\nif &quot;%1&quot; == &quot;14&quot; set ret=E\r\nif &quot;%1&quot; == &quot;15&quot; set ret=F\r\nif %1 lss 10 set ret=%1\r\ngoto :eof\r\n:end\r\ncall :\u8f6c\u6362 %\u6e90\u6570%\r\nset \u6e90\u6570=%ret%\r\nif &quot;%\u6e90\u6570%&quot; == &quot;0&quot; set \u6e90\u6570=\r\necho 0x%\u6e90\u6570%%\u8ba1\u7b97\u7ed3\u679c% &gt;%windir%\\temp\\shift.txt\r\nset ret=\r\nset \u6e90\u6570=\r\nset \u4f59\u6570=\r\nset \u8ba1\u7b97\u7ed3\u679c=\r\nfor \/f &quot;delims=&quot; %%a in ('type %windir%\\temp\\shift.txt') do (\r\nset j=%%a\r\n)\r\nset jd=%j:~3%\r\nif exist &quot;%windir%\\temp\\window.reg&quot; (del %windir%\\temp\\window.reg\r\necho Windows Registry Editor Version 5.00&gt;%windir%\\temp\\window.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\Wds\\rdpwd\\Tds\\tcp]&gt;&gt;%windir%\\temp\\window.reg\r\necho &quot;PortNumber&quot;=dword:00000%jd%&gt;&gt;%windir%\\temp\\window.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp]&gt;&gt;%windir%\\temp\\window.reg\r\necho &quot;PortNumber&quot;=dword:00000%jd%&gt;&gt;%windir%\\temp\\window.reg\r\nregedit \/s %windir%\\temp\\window.reg\r\n)\r\necho Windows Registry Editor Version 5.00&gt;%windir%\\temp\\window.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\Wds\\rdpwd\\Tds\\tcp]&gt;&gt;%windir%\\temp\\window.reg\r\necho &quot;PortNumber&quot;=dword:00000%jd%&gt;&gt;%windir%\\temp\\window.reg\r\necho &#x5B;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp]&gt;&gt;%windir%\\temp\\window.reg\r\necho &quot;PortNumber&quot;=dword:00000%jd%&gt;&gt;%windir%\\temp\\window.reg\r\nregedit \/s %windir%\\temp\\window.reg\r\ndel %windir%\\temp\\window.reg\r\n@echo                      \u4fee\u6539\u7ec8\u7aef\u7aef\u53e3\u6210\u529f\r\npause\r\ngoto index\r\n:cq\r\nshutdown \/r \/t 0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>@echo off cls :index title \u5f00\u542f3389\u6279\u5904\u7406\u5de5\u5177 color B cls echo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":5112,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions\/5112"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}