﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-梦幻白桦林-文章分类-操作系统</title><link>http://www.cppblog.com/colys/category/4168.html</link><description>LIFE AS CODE</description><language>zh-cn</language><lastBuildDate>Sun, 25 May 2008 00:22:54 GMT</lastBuildDate><pubDate>Sun, 25 May 2008 00:22:54 GMT</pubDate><ttl>60</ttl><item><title>winxp通过注册表添加删除系统服务</title><link>http://www.cppblog.com/colys/articles/37890.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Wed, 05 Dec 2007 15:43:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/37890.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/37890.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/37890.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/37890.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/37890.html</trackback:ping><description><![CDATA[在Windows XP系统的&#8220;服务&#8221;窗口中并不能添加或删除服务，常用的方法有以下几种：
　　修改注册表
　　在&#8220;开始&#8594;运行&#8221;中键入&#8220;regedit.exe&#8221;，打开&#8220;注册表编辑器&#8221;，展开分支&#8220;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services&#8221;，在右侧窗格中显示的就是本机安装的服务项。
　　如果要新建服务，只须点击&#8220;编辑&#8594;新建&#8594;项&#8221;，然后为此项命名，如&#8220;test&#8221;；然后右击该项，选择&#8220;新建&#8594;字符串值&#8221;或&#8220;新建&#8594;DWORD值&#8221;即可。添加一个服务项目具体需要添加的键值如下：
　　&#8220;DisplayName&#8221;，字符串值，对应服务名称；
　　&#8220;Descrīption&#8221;，字符串值，对应服务描述；
　　&#8220;ImagePath&#8221;，字符串值，对应该服务程序所在的路径；
　　&#8220;ObjectName&#8221;，字符串值，值为&#8220;LocalSystem&#8221;，表示本地登录；
　　&#8220;ErrorControl&#8221;，DWORD值，值为&#8220;1&#8221;；
　　&#8220;Start&#8221;，DWORD值，值为2表示自动运行，值为3表示手动运行，值为4表示禁止；
　　&#8220;Type&#8221;，DWORD值，应用程序对应10，其他对应20。<img src ="http://www.cppblog.com/colys/aggbug/37890.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-12-05 23:43 <a href="http://www.cppblog.com/colys/articles/37890.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MS远程桌面连接最大用户数</title><link>http://www.cppblog.com/colys/articles/32892.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Wed, 26 Sep 2007 02:51:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/32892.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/32892.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/32892.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/32892.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/32892.html</trackback:ping><description><![CDATA[在用远程桌面管理服务器时，我经常碰到&#8220;已达到最大连接数&#8221;的错误提示，以前一直以为是服务器上面的策略设置问题，但是查看了N多可设置项，没有任何相关东东。<br><br>原来Sega技术部的人在安装终端服务的时候选择安装了管理模式，而不是应用模式，而且，现在烦恼的是，安装后无法进行更改，除非重装系统。<br><br>
<div class="quote">
<div class="quote-title">引用自 ms win2k3 主页关于Terminal Services的一些FAQ</div>
<div class="quote-content"><br><br>问： &nbsp;我怎样才能将2个以上的用户连接到Windows 2000 Server或Windows
Server 2003？我能够在Windows XP Professional上连接1个以上的用户吗？ <br><br>答：如果您运行在Windows
2000或Windows Server 2003的远程管理（Remote
Administration）模式中，那么最多只有两名并发用户能够连接到系统中，您无法增加能够同时连接的用户数量，除非您切换到应用程序服务器（Application
Server）模式。Application Server模式需要客户机访问许可证和一台许可服务器。如果您正在使用Windows XP
Professional，能够同时连接到系统的用户数量将被限制在1位用户，没有任何办法能够提高这种数量限制。<br><br><a href="http://www.microsoft.com/china/windowsserver2003/community/centers/terminal/terminal_faq.asp" target="_blank">查看更多FAQ</a><br><br></div>
</div>
<br><br><br><br>当管理员安装终端服务的时候，可以在两种服务模式中选择其一：远程管理模式和应用程序服务器模式。<br><br>远程管理模式给予管理员一个强有力的基于图形用户界面的工具，利用它管理员可以通过TCP/IP连接及远程管理任意一台基于Windows
2000的服务器。他们可以管理文件和打印机共享，控制网络上其他计算机的登录，或者从控制台执行几乎所有的任务。这个模式提供了在Windows
2000环境中最广泛和强大的远程管理功能。远程管理模式仅仅安装了终端服务中用来进行远程访问的那部分组件，而不像应用程序服务器模式那样，需要装载应用程序共享的组件和进行进程调度。这就意味着远程管理模式运行的时候，仅仅需要很小的系统开销就可以用于以任务为主的文件、打印操作，以及与Back
Office应用服务器的连接。终端服务允许同时进行最多两个远程管理模式连接。此时，只有系统管理员可以打开某个连接，这样就保证了服务器不会受到来自终端用户的无意访问或者恶意的访问。两个远程管理连接不需要额外的许可证，同时也不需要一台拥有终端服务许可证的服务器。<br><br>应用程序服务器模式中，可以从一个中心位置来进行应用程序的配置和管理。这样可以节约管理员进行初始开发和配置所需的时间，以及将来进行维护和升级时所需花费的时间和精力。一旦某个应用程序通过终端服务进行了配置，其他客户就可以使用远程连接、局域网或广域网来进行连接。客户机可以是基于Windows的、Windows
CE、甚至不基于Windows也没有关系。当设置一台终端服务器为应用程序服务器时，需要得到许可证。每个客户端，无论使用什么协议连接到终端服务器，都必须拥有终端服务客户访问许可证（Terminal
Services Client Access License，简称为TSCAL）和Windows 2000服务器客户访问许可证（Client Access
License，简称为2000CAL）。
<br><img src ="http://www.cppblog.com/colys/aggbug/32892.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-09-26 10:51 <a href="http://www.cppblog.com/colys/articles/32892.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>window任务计划命令详解</title><link>http://www.cppblog.com/colys/articles/29642.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Thu, 09 Aug 2007 06:10:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/29642.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/29642.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/29642.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/29642.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/29642.html</trackback:ping><description><![CDATA[<h1>Schtasks</h1>
<p>安排命令和程序定期运行或在指定时间内运行。从计划表中添加和删除任务，按需要启动和停止任务，显示和更改计划任务。</p>
<p>若要查看该命令语法，请单击以下命令：</p>
<p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create</font></u></a></p>
<div class=expand>
<p>创建新的计划任务。</p>
<h2>语法</h2>
<p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc</strong> <em>schedule</em></nobr> <nobr>[<strong>/mo</strong> <em>modifier</em>]</nobr> <nobr>[<strong>/d</strong> <em>day</em>]</nobr> <nobr>[<strong>/m</strong> <em>month</em>[<strong>,</strong><em>month</em>...]</nobr> <nobr>[<strong>/i</strong> <em>IdleTime</em>]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> <nobr><strong>/?</strong></nobr> </p>
</div>
<h2>参数</h2>
<dl>
<dt><strong>/tn</strong> <em>TaskName</em>
<dd>指定任务的名称。
<dt><strong>/tr</strong> <em>TaskRun</em>
<dd>指定任务运行的程序或命令。键入可执行文件、脚本文件或批处理文件的完全合格的路径和文件名。如果忽略该路径，SchTasks.exe 将假定文件在 <em>Systemroot</em>\System32 目录下。
<dt><strong>/sc</strong> <em>schedule</em>
<dd>指定计划类型。有效值为 MINUTE、HOURLY、DAILY、WEEKLY、MONTHLY、ONCE、ONSTART、ONLOGON、ONIDLE。
<table>
    <tbody>
        <tr>
            <th>值</th>
            <th>说明</th>
        </tr>
        <tr>
            <td><strong>MINUTE、HOURLY、DAILY、WEEKLY、MONTHLY</strong></td>
            <td>指定计划的时间单位。</td>
        </tr>
        <tr>
            <td><strong>ONCE</strong></td>
            <td>任务在指定的日期和时间运行一次。</td>
        </tr>
        <tr>
            <td><strong>ONSTART</strong></td>
            <td>任务在每次系统启动的时候运行。可以指定启动的日期，或下一次系统启动的时候运行任务。</td>
        </tr>
        <tr>
            <td><strong>ONLOGON</strong></td>
            <td>每当用户（任意用户）登录的时候，任务就运行。可以指定日期，或在下次用户登录的时候运行任务。</td>
        </tr>
        <tr>
            <td><strong>ONIDLE</strong></td>
            <td>只要系统空闲了指定的时间，任务就运行。可以指定日期，或在下次系统空闲的时候运行任务。</td>
        </tr>
    </tbody>
</table>
<dt><strong>/mo</strong> <em>modifier</em>
<dd>指定任务在其计划类型内的运行频率。这个参数对于 MONTHLY 计划是必需的。对于 MINUTE、HOURLY、DAILY 或 WEEKLY 计划，这个参数有效，但也可选。默认值为 1。
<table>
    <tbody>
        <tr>
            <th>计划类型</th>
            <th>修饰符</th>
            <th>说明</th>
        </tr>
        <tr>
            <td>MINUTE</td>
            <td><strong>1</strong> ～ <strong>1439</strong></td>
            <td>任务每 <em>n</em> 分钟运行一次。</td>
        </tr>
        <tr>
            <td>HOURLY</td>
            <td><strong>1</strong> ～ <strong>23</strong></td>
            <td>任务每 <em>n</em> 小时运行一次。</td>
        </tr>
        <tr>
            <td>DAILY</td>
            <td><strong>1</strong> ～ <strong>365</strong></td>
            <td>任务每 <em>n</em> 天运行一次。</td>
        </tr>
        <tr>
            <td>WEEKLY</td>
            <td><strong>1</strong> ～ <strong>52</strong></td>
            <td>任务每 <em>n</em> 周运行一次。</td>
        </tr>
        <tr>
            <td rowSpan=3>MONTHLY</td>
            <td><strong>1</strong> ～ <strong>12</strong></td>
            <td>任务每 <em>n</em> 月运行一次。</td>
        </tr>
        <tr>
            <td><strong>LASTDAY</strong></td>
            <td>任务在月份的最后一天运行。</td>
        </tr>
        <tr>
            <td><strong>FIRST</strong>、<strong>SECOND</strong>、<strong>THIRD</strong>、<strong>FOURTH</strong>、<strong>LAST</strong></td>
            <td>与 <nobr><strong>/d</strong> <em>day</em></nobr> 参数共同使用,并在特定的周和天运行任务。例如，在月份的第三个周三。</td>
        </tr>
    </tbody>
</table>
<dt><strong>/d</strong> <em>dirlist</em>
<dd>指定周或月的一天。只与 WEEKLY 或 MONTHLY 计划共同使用时有效。
<table>
    <tbody>
        <tr>
            <th>计划类型</th>
            <th>日期值</th>
        </tr>
        <tr>
            <td>WEEKLY</td>
            <td>可选项。有效值是 MON ~ SUN 和 * （每一天）。MON 是默认值。</td>
        </tr>
        <tr>
            <td>MONTHLY</td>
            <td>在使用 FIRST、SECOND、THIRD、FOURTH 或 LAST 修饰符 (<strong>/mo</strong>) 时，需要 MON ～ SUN 中的某个值。1 ～ 31 是可选的，只在没有修饰符或修饰符为 <nobr>1 ～ 12</nobr> 类型时有效。默认值是 1 （月份的第一天）。</td>
        </tr>
    </tbody>
</table>
<dt><strong>/m</strong> <em>month</em>[<strong>,</strong><em>month</em>...]
<dd>指定一年中的一个月。有效值是 JAN ～ DEC 和 * （每个月）。<strong>/m</strong> 参数只对于 MONTHLY 计划有效。在使用 LASTDAY 修饰符时，这个参数是必需的。否则，它是可选的，默认值是 * （每个月）。
<dt><strong>/i</strong> <em>InitialPageFileSize</em>
<dd>指定任务启动之前计算机空闲多少分钟。键入一个 <nobr>1 ～ 999</nobr> 之间的整数。这个参数只对于 ONIDLE 计划有效，而且是必需的。
<dt><strong>/st</strong> <em>StartTime</em>
<dd>以 <nobr>HH:MM:SS</nobr> 24 小时格式指定时间。默认值是命令完成时的当前本地时间。<nobr><strong>/st</strong></nobr> 参数只对于 MINUTE、HOURLY、DAILY、WEEKLY、MONTHLY 和 ONCE 计划有效。它只对于 ONCE 计划是必需的。
<dt><strong>/sd</strong> <em>StartDate</em>
<dd>以 <nobr><em>MM</em>/<em>DD</em>/<em>YYYY</em></nobr> 格式指定任务启动的日期。默认值是当前日期。<nobr><strong>/sd</strong></nobr> 参数对于所有的计划有效，但只对于 ONCE 计划是必需的。
<dt><strong>/ed</strong> <em>EndDate</em>
<dd>指定任务计划运行的最后日期。此参数是可选的。它对于 ONCE、ONSTART、ONLOGON 或 ONIDLE 计划无效。默认情况下，计划没有结束日期。
<dt><strong>/s</strong> <em>Computer</em>
<dd>指定远程计算机的名称或 IP 地址（带有或者没有反斜杠）。默认值是本地计算机。
<dt><strong>/u</strong> [<em>domain</em>\]<em>user</em>
<dd>使用特定用户帐户的权限运行命令。默认情况下，使用已登录到运行 SchTasks 的计算机上的用户的权限运行命令。
<dt><strong>/p</strong> <em>password</em>
<dd>指定在 <strong>/u</strong> 参数中指定的用户帐户的密码。如果使用 <strong>/u</strong> 参数，则需要该参数。
<dt><strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>}
<dd>使用指定用户帐户的权限运行任务。默认情况下，使用用户登录到运行 SchTasks 的计算机上的权限运行任务。
<table>
    <tbody>
        <tr>
            <th>值</th>
            <th>说明</th>
            <tr>
            </tr>
            <tr>
                <td>[<em></em><em></em><em>domain</em>\}<em>User</em>?</td>
                <td>指定用户帐户。</td>
            </tr>
            <tr>
                <td><strong>"System"</strong> 或 <strong>""</strong></td>
                <td>指定操作系统使用的 NT Authority\System 帐户。</td>
            </tr>
        </tbody>
    </table>
    <dt><strong>/p</strong> <em>Password</em>
    <dd>指定用户帐户的密码，该用户帐户在 <nobr><strong>/u</strong></nobr> 参数中指定。如果在指定用户帐户的时候忽略了这个参数，SchTasks.exe 会提示您输入密码而且不显示键入的文本。使用 NT Authority\System 帐户权限运行的任务不需要密码，SchTasks.exe 也不会提示索要密码。
    <dt><strong>/?</strong>
    <dd>在命令提示符显示帮助。 </dd></dl>
    <h2>注释</h2>
    <ul><noloc><span class=reuse id=s_u_p_remark>XOX</span></noloc>
        <li>SchTasks.exe 不验证程序文件的位置或用户帐户密码。如果没有为用户帐户输入正确的文件位置或正确的密码，任务仍然可以创建，但不会运行。另外，如果帐户的密码更改或过期，而且没有更改存储在任务中的密码，那么任务也不会运行。
        <li>NT Authority\System 帐户没有交互式登录权限。用户看不到以系统权限运行的程序，不能与之交互。
        <li>每个任务只运行一个程序。但是，可以创建一个批处理文件来启动多个任务，然后计划一个任务来运行该批处理文件。
        <li>只要创建了任务就可对其测试。使用 <strong>run</strong> 操作来测试任务，然后从 SchedLgU.txt 文件 ( <em>Systemroot</em>\SchedLgU.txt ) 中查阅错误。 </li>
    </ul>
    <h2>每个计划类型的语法和范例。</h2>
    <p>若要查看该命令语法，请单击以下命令：</p>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create minute</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc minute</strong></nobr> <nobr>[<strong>/mo</strong> {1 - 1439}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划任务每 20 分钟运行一次。</h4>
    <p>下面的命令计划安全脚本 Sec.vbs 每 20 分钟运行一次。由于命令没有包含起始日期或时间，任务在命令完成 20 分钟后启动，此后每当系统运行它就每 20 分钟运行一次。请注意，安全脚本源文件位于远程计算机上，但任务在本地计算机上计划并执行。</p>
    <p><nobr><strong>schtasks /create /sc minute /mo 20 /tn "Security Script" /tr \\central\data\scripts\sec.vbs</strong></nobr></p>
    <p>作为响应，SchTasks.exe 显示一条消息来说明任务会以当前用户的权限运行并需要当前用户的密码。输入密码时，SchTasks.exe 不显示键入的文本。</p>
    <pre><code>
    The task will be created under current logged-in user name.
    Please enter the password
    ************
    </code></pre>
    <p>然后 SchTasks.exe 显示一条消息表明已计划该任务：</p>
    <code>成功：计划任务 "Security Script" 已成功创建。</code>
    <p>查询显示命令计划的任务：</p>
    <pre><code>
    TaskName                  Next Run Time            Status
    ========================= ======================== ==============
    Security Script           10:50:00 AM , 4/4/2001
    </code></pre>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create hourly</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc hourly</strong></nobr> <nobr>[<strong>/mo</strong> {1 - 365}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划命令在每小时过五分的时候运行。</h4>
    <p>下面的命令将计划 MyApp 程序从午夜过后五分钟起每小时运行一次。因为忽略了 <nobr><strong>/mo</strong></nobr> 参数，命令使用了小时计划的默认值，即每 (1) 小时。如果该命令在 12:05 A.M 之后生成，程序将在第二天才会运行。</p>
    <p><nobr><strong>schtasks /create /sc hourly /st 00:05:00 /tn "My App" /tr c:\apps\myapp.exe</strong></nobr></p>
    <h4>计划命令每五小时运行一次</h4>
    <p>下面的命令计划 MyApp 程序从 2001 年 3 月的第一天起每五小时运行一次。它使用 <nobr><strong>/mo</strong></nobr> 参数来指定间隔时间，使用 <nobr><strong>/sd</strong></nobr> 参数来指定起始日期。由于命令没有指定起始时间，当前时间被用作起始时间。</p>
    <p><strong>schtasks /create /sc hourly /mo 5 /sd 03/01/2001 /tn "My App" /tr c:\apps\myapp.exe</strong></p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create daily</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc daily</strong></nobr> <nobr>[<strong>/mo</strong> {1 - 365}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    </div>
    <h3>范例</h3>
    <h4>计划任务每天运行一次</h4>
    <p>下面的范例计划 MyApp 程序在每天的 8:00 A.M. 运行一次，直到 2001 年 12 月 31 日结束。由于它忽略了 <nobr><strong>/mo</strong></nobr> 参数，所以使用默认间隔 1 来每天运行命令。</p>
    <p><nobr><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc daily /st 08:00:00 /ed 12/31/2001</strong></nobr></p>
    <h4>计划任务每隔一天运行一次</h4>
    <p>下面的范例计划 MyApp 程序从 2001 年 12 月 31 日起每隔一天在 1:00 P.M. (13:00) 运行。命令使用 <nobr><strong>/mo</strong></nobr> 参数来指定两 (2) 天的间隔。</p>
    <p><nobr><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc daily /mo 2 /st 13:00:00 /sd 12/31/2001</strong></nobr></p>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create weekly</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc weekly</strong></nobr> <nobr>[<strong>/d</strong> {<em>MON - SUN</em> | *}]</nobr> <nobr>[<strong>/mo</strong> {1 - 52}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划任务每六周运行一次</h4>
    <p>下面的命令计划 MyApp 程序在远程计算机上每六周运行一次。该命令使用 <nobr><strong>/mo</strong></nobr> 参数来指定间隔。它也使用 <nobr><strong>/s</strong></nobr> 参数来指定远程计算机，使用 <nobr><strong>/ru</strong></nobr> 参数来计划任务以用户的 Administrator 帐户权限运行。因为忽略了 <nobr><strong>/rp</strong></nobr> 参数，SchTasks.exe 会提示用户输入 Administrator 帐户密码。</p>
    <p>另外，因为命令是远程运行的，所以命令中所有的路径，包括到 MyApp.exe 的路径，都是指向远程计算机上的路径。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc weekly /mo 6 /s Server16 /ru Admin01</strong></p>
    <h4>计划任务每隔一周在周五运行</h4>
    <p>下面的命令计划任务每隔一周在周五运行。它使用 <nobr><strong>/mo</strong></nobr> 参数来指定两周的间隔，使用 <nobr><strong>/d</strong></nobr> 参数来指定是一周内的哪一天。如计划任务在每个周五运行，要忽略 <nobr><strong>/mo</strong></nobr> 参数或将其设置为 1。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc weekly /mo 2 /d FRI</strong></p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create monthly</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <dl>
    <dt>常规月计划语法
    <dd><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc monthly</strong></nobr> <nobr>[<strong>/mo</strong> {<strong>FIRST</strong> | <strong>SECOND</strong> | <strong>THIRD</strong> | <strong>FOURTH</strong> | <strong>LAST</strong> | <strong>LASTDAY</strong>]</nobr> <nobr>[<strong>/d</strong> {<strong>MON</strong> - <strong>SUN</strong> | <strong>1</strong> - <strong>31</strong>}</nobr>] <nobr>[<strong>/m</strong> {<strong>JAN</strong> - <strong>DEC</strong>[<strong>,</strong><strong>JAN</strong> - <strong>DEC</strong>...] | <strong>*</strong>}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr>
    <dt>指定周的语法
    <dd><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc monthly</strong></nobr> <nobr><strong>/mo</strong> {<strong>FIRST</strong> | <strong>SECOND</strong> | <strong>THIRD</strong> | <strong>FOURTH</strong> | <strong>LAST</strong>}</nobr> <nobr><strong>/d</strong> {<strong>MON</strong> - <strong>SUN</strong>}</nobr> <nobr>[<strong>/m</strong> {<strong>JAN</strong> - <strong>DEC</strong>[<strong>,</strong><strong>JAN</strong> - <strong>DEC</strong>...] | <strong>*</strong>}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr>
    <dt>Lastday 语法
    <dd><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc monthly</strong></nobr> <nobr><strong>/mo LASTDAY</strong></nobr> <nobr><strong>/m</strong> {<strong>JAN</strong> - <strong>DEC</strong>[<strong>,</strong><strong>JAN</strong> - <strong>DEC</strong>...] | <strong>*</strong>}</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr>
    <dt>指定日期的语法
    <dd><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc monthly</strong></nobr> <nobr><strong>/d</strong> {<strong>1</strong> - <strong>31</strong>}</nobr> <nobr>[<strong>/m</strong> {<strong>JAN</strong> - <strong>DEC</strong>[<strong>,</strong><strong>JAN</strong> - <strong>DEC</strong>...] | *}]</nobr> <nobr>[<strong>/st</strong> <em>StartTime</em>]</nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/ed</strong> <em>EndDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </dd></dl>
    <h3>范例</h3>
    <h4>计划任务在每月的第一天运行</h4>
    <p>下面的命令计划 MyApp 程序在每月的第一天运行。因为默认修饰符是 none（即：没有修饰符），默认天是第一天，默认的月份是每个月，所以该命令不需要任何其它的参数。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly</strong></p>
    <h4>计划任务在每月的最后一天运行</h4>
    <p>下面的命令计划 MyApp 程序在每月的最后一天运行。它使用 <strong>/mo</strong> 参数指定在每月的最后一天运行程序，使用通配符 (*) 与 <strong>/m</strong> 参数表明在每月的最后一天运行程序。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /mo lastday /m *</strong></p>
    <h4>计划任务每三个月运行一次</h4>
    <p>下面的命令计划 MyApp 程序每三个月运行一次。.它使用 <strong>/mo</strong> 参数来指定间隔。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /mo 3</strong></p>
    <h4>计划任务在每月的第二个周日运行</h4>
    <p>下面的命令计划 MyApp 程序在每月的第二个周日运行。它使用 <nobr><strong>/mo</strong></nobr> 参数指定是每月的第二周，使用 <nobr><strong>/d</strong></nobr> 参数指定天。</p>
    <p><nobr><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /mo SECOND /d SUN</strong></nobr></p>
    <h4>计划任务在五月和六月的第 15 天运行。</h4>
    <p>下面的命令计划 MyApp 程序在五月 15 日和六月 15 日的 3:00 PM (15:00) 运行。它使用 <nobr><strong>/d</strong></nobr> 参数来指定日期，使用 <nobr><strong>/m</strong></nobr> 参数指定月份。它也使用 <strong>/st</strong> 参数来指定开始时间。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /d 15 /m MAY,JUN /st 15:00:00</strong></p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create once</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc once</strong></nobr> <nobr><strong>/st</strong> <em>StartTime</em></nobr> <nobr><strong>/sd</strong> <em>StartDate</em></nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划任务运行一次</h4>
    <p>下面的命令计划 MyApp 程序在 2002 年 1 月 1 日午夜运行一次。它使用 <nobr><strong>/ru</strong></nobr> 参数指定以用户的 Administrator 帐户权限运行任务，使用 <nobr><strong>/rp</strong></nobr> 参数为 Administrator 帐户提供密码。</p>
    <p><nobr><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc once /st 00:00:00 /sd 01/01/2002 /ru Admin23 /rp p@ssworD1</strong></nobr></p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create onstart</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc onstart</strong></nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划任务在每次系统启动的时候运行</h4>
    <p>下面的命令计划 MyApp 程序在每次系统启动的时候运行，起始日期是 2001 年 3 月 15 日。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc onstart /sd 03/15/2001</strong></p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create onlogon</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc onlogon</strong></nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划任务在用户登录到远程计算机的时候运行</h4>
    <p>下面的命令计划批处理文件在用户（任何用户）每次登录到远程计算机上的时候运行。它使用 <nobr><strong>/s</strong></nobr> 参数指定远程计算机。因为命令是远程的，所以命令中所有的路径，包括批处理文件的路径，都指定为远程计算机上的路径。</p>
    <p><nobr><strong>schtasks /create /tn "Start Web Site" /tr c:\myiis\webstart.bat /sc onlogon /s Server23</strong></nobr></p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks create onidle</font></u></a></p>
    <div class=expand>
    <h3>语法</h3>
    <p><strong>schtasks</strong> <nobr><strong>/create</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr><strong>/tr</strong> <em>TaskRun</em></nobr> <nobr><strong>/sc onidle</strong></nobr> <nobr><strong>/i</strong><em>IdleTime</em></nobr> <nobr>[<strong>/sd</strong> <em>StartDate</em>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/ru</strong> {[<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>} [<strong>/rp</strong> <em>Password</em>]]</nobr> </p>
    <h3>范例</h3>
    <h4>计划某项任务在计算机空闲的时候运行</h4>
    <p>下面的命令计划 MyApp 程序在计算机空闲的时候运行。它使用必需的 <nobr><strong>/i</strong></nobr> 参数指定在启动任务之前计算机必需持续空闲十分钟。</p>
    <p><nobr><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc onidle /i 10</strong></nobr></p>
    </div>
    <h2>更多范例</h2>
    <p>若要查看范例，请单击范例名称：</p>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>创建以 System 权限运行的任务</font></u></a></p>
    <div class=expand>
    <p>下面的命令计划 MyApp 程序以 NT Authority\System 帐户权限运行。在这个范例中，任务计划在每月的第一天运行，但对于以系统权限运行的任务可以使用所有的计划类型。</p>
    <p>该命令使用 <strong>/ru "System"</strong> 参数指定系统安全上下文。因为系统任务不需要密码，所以忽略了 <strong>/rp</strong> 参数。</p>
    <p><strong>schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /d 1 /ru "System"</strong></p>
    <p>作为响应，SchTasks.exe 显示一个信息性消息和一个成功消息。它不提示输入密码。</p>
    <pre><code>
    信息：此任务将被创建于用户名下 ("NT AUTHORITY\SYSTEM")。
    成功：计划任务 "My App" 已成功创建。
    </code></pre>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>创建运行多个程序的任务</font></u></a></p>
    <div class=expand>
    <p>每个任务只能运行一个程序。但是可以创建一个运行多个程序的批处理文件，然后计划一个任务来运行该批处理文件。下面的过程说明了这个方法：</p>
    <ol>
        <li>创建一个启动要运行程序的批处理文件。
        <p>在这个范例中创建了一个启动&#8220;事件查看器&#8221;(Eventvwr.exe) 和&#8220;系统监视器&#8221;(Perfmon.exe) 的批处理文件。</p>
        <ul>
            <li>启动文本编辑器，例如&#8220;记事本&#8221;。
            <li>键入每个程序的名称和指向可执行文件的完全合格的路径。在这种情况下，文件包含有下列语句。
            <p><strong>C:\Windows\System32\Eventvwr.exe</strong><br><strong>C:\Windows\System32\Perfmon.exe</strong></p>
            <li>将文件存储为 MyApps.bat。 </li>
        </ul>
        <li>使用 SchTasks.exe 创建一个运行 MyApps.bat 的任务。
        <p>下面的命令创建了 Monitor 任务，每当有人登录它就运行。它使用 <strong>/tn</strong> 参数命名任务，使用 <strong>/tr</strong> 参数运行 MyApps.bat。它使用 <strong>/sc</strong> 参数来指明 OnLogon 计划类型，使用 <strong>/ru</strong> 参数指定 Administrator 帐户。</p>
        <p><strong>schtasks /create /tn Monitor /tr C:\MyApps.bat /sc onlogon /ru Reskit\Administrator</strong></p>
        <p>该命令的结果是，每当用户登录到计算机，任务就启动&#8220;事件查看器&#8221;和&#8220;系统监视器&#8221;。</p>
        </li>
    </ol>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>更改计划任务</font></u></a></p>
    <div class=expand><a name=change></a>
    <p>更改一个或多个下列任务属性。</p>
    <ul>
        <li>任务运行的程序 (<strong>/tr</strong>)。
        <li>任务运行的用户帐户 (<strong>/ru</strong>)。
        <li>用户帐户的密码 (<strong>/rp</strong>)。 </li>
    </ul>
    <h2>语法</h2>
    <p><strong>schtasks</strong> <nobr><strong>/change</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/tr</strong> <em>TaskRun</em>]</nobr> <nobr>[<strong>/ru</strong> [<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>]</nobr> <nobr>[<strong>/rp</strong> <em>Password</em>]</nobr></p>
    <h2>参数</h2>
    <dl>
    <dt><strong>/tn</strong> <em>TaskName</em>
    <dd>标识要更改的任务。输入任务名。
    <dt><strong>/s</strong> <em>Computer</em>
    <dd>指定远程计算机的名称或 IP 地址（带有或者没有反斜杠）。默认值是本地计算机。
    <dt><strong>/u</strong> [<em>domain</em>\]<em>user</em>
    <dd>使用特定用户帐户的权限运行命令。默认情况下，使用已登录到运行 SchTasks 的计算机上的用户的权限运行命令。
    <dt><strong>/p</strong> <em>password</em>
    <dd>指定在 <strong>/u</strong> 参数中指定的用户帐户的密码。如果使用 <strong>/u</strong> 参数，则需要该参数。
    <dt><strong>/tr</strong> <em>TaskRun</em>
    <dd>更改任务运行的程序。输入可执行文件、脚本文件或批处理文件的完全合格的路径和文件名。如果忽略了路径，SchTasks.exe 假定文件在 <em>Systemroot</em>\System32 目录下指定的程序替换任务最初运行的程序。
    <dt><strong>/ru</strong> [<em>Domain</em>\]<em>User</em> | <strong>"System"</strong>
    <dd>更改用于任务的用户帐户。
    <table>
        <tbody>
            <tr>
                <th>值</th>
                <th>说明</th>
            </tr>
            <tr>
                <td>[<em></em><em></em><em>domain</em>\]<em>User</em></td>
                <td>指定用户帐户</td>
            </tr>
            <tr>
                <td><strong>"System"</strong> or <strong>""</strong></td>
                <td>指定为操作系统所使用的 NT Authority\System 帐户。</td>
            </tr>
        </tbody>
    </table>
    <p>在更改用户帐户的时候，必须也要更改用户密码。如果命令带有 <strong>/ru</strong> 参数，但没有 <strong>/rp</strong> 参数，SchTasks.exe 提示要求输入新的密码而且不显示键入的文本。</p>
    <p>任务以不需要密码的 NT Authority\System 帐户权限运行，SchTasks.exe 不会提示输入密码。</p>
    <dt><strong>/p</strong> <em>Password</em>
    <dd>更改用于任务的帐户密码。输入新的密码。
    <dt><strong>/?</strong>
    <dd>在命令提示符显示帮助。 </dd></dl>
    <h2>注释</h2>
    <ul><noloc><span class=reuse id=s_u_p_remark>XOX</span></noloc>
        <li><strong>/tn</strong> 和 <strong>/s</strong> 参数标识该任务。<strong>/tr</strong>、<strong>/ru</strong> 和 <strong>/rp</strong> 参数指定可以更改的任务属性。
        <li>使用 <strong>change</strong> 操作的命令必须至少更改一个任务属性。
        <li>NT Authority\System 帐户没有交互式登录权限。用户看不到以系统权限运行的程序，不能与其交互。 </li>
    </ul>
    <h2>范例</h2>
    <h3>更改任务运行的程序</h3>
    <p>下面的命令将 Virus Check 任务运行的程序由 VirusCheck.exe 更改为 VirusCheck2.exe。此命令使用 <strong>/tn</strong> 参数标识任务，使用 <strong>/tr</strong> 参数指定任务的新程序。（不能更改任务名称。）</p>
    <p><nobr><strong>schtasks /change /tn "Virus Check" /tr C:\VirusCheck2.exe</strong></nobr></p>
    <p>作为响应，SchTasks.exe 显示以下成功消息：</p>
    <pre><code>成功：计划任务 "Virus Check" 的参数已更改。</code></pre>
    <p>此命令的结果是，Virus Check 任务现运行 VirusCheck2.exe。</p>
    <h3>更改远程任务的用户密码</h3>
    <p>下面的命令更改用于远程计算机 Svr01 上 RemindMe 任务的用户帐户密码。命令使用 <strong>/tn</strong> 参数标识任务，使用 <strong>/s</strong> 参数指定远程计算机。它使用 <strong>/rp</strong> 参数指定新的密码 p@ssWord3。</p>
    <p>在用户帐户密码过期或更改的时候需要此过程。如果存储在任务中的密码无效，那么任务不会运行。</p>
    <p><nobr><strong>schtasks /change /tn RemindMe /s Svr01 /rp p@ssWord3</strong></nobr></p>
    <p>作为响应，SchTasks.exe 显示以下成功消息：</p>
    <pre><code>成功：计划任务 "RemindMe" 的参数已更改。</code></pre>
    <p>这个命令的结果是，RemindMe 任务现在以其初始的用户帐户运行，但拥有一个新密码。</p>
    <h3>更改任务的程序和用户帐户</h3>
    <p>下面的命令更改任务运行的程序以及任务运行的用户帐户。实质上，它将旧的计划用于新的任务。这个命令将每天早上 9:00 a.m. 启动 "Notepad.exe" 的 Notepad 任务更改为启动 "Internet Explorer"。</p>
    <p>该命令使用 <strong>/tn</strong> 参数来标识任务。它使用 <strong>/tr</strong> 参数更改任务运行的程序，使用 <strong>/ru</strong> 参数更改任务运行凭据的用户帐户。</p>
    <p>忽略为用户帐户提供密码的 <strong>/rp</strong> 参数。必须为帐户提供密码，但可以使用 <strong>/rp</strong> 参数以及在明文中键入密码，或等待 SchTasks.exe 要求输入密码的提示，然后以不显示文本的方式输入密码。</p>
    <p><nobr><strong>schtasks /change /tn Notepad /tr "c:\program files\Internet Explorer\iexplore.exe" /ru DomainX\Admin01</strong></nobr></p>
    <p>作为响应，SchTasks.exe 索要用于用户帐户的密码。它不显示键入的文本，因此密码不可见。</p>
    <pre><code><nobr>Please enter the password for DomainX\Admin01: <strong>*********</strong></nobr></code></pre>
    <p>请注意，<strong>/tn</strong> 参数标识任务，<strong>/tr</strong> 和 <strong>/ru</strong> 参数更改任务的属性。不能使用另外一个参数来标识任务，而且不能更改任务的名称。</p>
    <p>作为响应，SchTasks.exe 显示以下成功消息：</p>
    <pre><code>成功：计划任务 "Notepad" 的参数已更改。</code></pre>
    <p>这个命令的结果是：RemindMe 任务现在以其初始的用户帐户运行，但拥有一个新密码。</p>
    <h3>将程序更改为 System 帐户</h3>
    <p>下面的命令更改了 SecurityScript 任务以使其以 NT Authority\System 帐户权限运行。它使用 <strong>/ru ""</strong> 参数来表示 System 帐户。</p>
    <p><strong>schtasks /change /tn SecurityScript /ru ""</strong></p>
    <p>作为响应，SchTasks.exe 显示以下成功消息：</p>
    <pre><code>成功：计划任务 "SecurityScript" 的参数已更改。</code></pre>
    <p>因为任务以 System 帐户权限运行不需要密码，所以 SchTasks.exe 不提示输入密码。</p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks run</font></u></a></p>
    <div class=expand><a name=run></a>
    <p>立即运行计划任务。<strong>run</strong> 操作忽略计划，但使用程序文件位置、用户帐户和存储在任务中的密码立即运行任务。</p>
    <h2>语法</h2>
    <p><strong>schtasks</strong> <nobr><strong>/run</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr><strong>/?</strong></nobr> </p>
    <h2>参数</h2>
    <dl>
    <dt><strong>/tn</strong> <em>TaskName</em>
    <dd>标识任务。该参数是必需的。
    <dt><strong>/s</strong> <em>Computer</em>
    <dd>指定远程计算机的名称或 IP 地址（带有或者没有反斜杠）。默认值是本地计算机。
    <dt><strong>/u</strong> [<em>domain</em>\]<em>user</em>
    <dd>使用特定用户帐户的权限运行命令。默认情况下，使用已登录到运行 SchTasks 的计算机上的用户的权限运行命令。
    <dt><strong>/p</strong> <em>password</em>
    <dd>指定在 <strong>/u</strong> 参数中指定的用户帐户的密码。如果使用 <strong>/u</strong> 参数，则需要该参数。
    <dt><strong>/?</strong>
    <dd>在命令提示符显示帮助。 </dd></dl>
    <h2>注释</h2>
    <ul><noloc><span class=reuse id=s_u_p_remark>XOX</span></noloc>
        <li>使用这个操作来测试任务。如果任务没有运行，请检查&#8220;任务计划程序服务&#8221;事务日志 <em>Systemroot</em>\SchedLgU.txt 以获取错误。
        <li>运行任务不会影响任务计划，不会更改为任务计划好的下次运行时间。
        <li>要远程运行任务，必须在远程计算机上计划任务。在运行该任务时，它仅在远程计算机上运行。要验证任务正在远程计算机上运行，请使用&#8220;任务管理器&#8221;或&#8220;任务计划程序&#8221;事务日志 <em>Systemroot</em>\SchedLgU.txt。 </li>
    </ul>
    <h2>范例</h2>
    <h3>在本地计算机上运行任务</h3>
    <p>下面的命令启动 "Security Script" 任务。</p>
    <p><strong>schtasks /run /tn "Security Script"</strong></p>
    <p>作为响应，SchTasks.exe 启动与任务相关联的脚本并显示以下消息：</p>
    <pre><code>成功：计划任务 "Security Script" 正在运行 ...</code></pre>
    <h3>在远程计算机上运行任务</h3>
    <p>下面的命令在远程计算机 Svr01 上运行 Update 任务：</p>
    <p><strong>schtasks /run /tn Update /s Svr01</strong></p>
    <p>此时，SchTasks.exe 显示以下错误消息：</p>
    <pre><code>错误:无法运行计划任务 "Update"。</code></pre>
    <p>查看 Svr01 上的 &#8220;计划任务程序&#8221;事务日志 C:\Windows\SchedLgU.txt 以获取错误的原因。在这种情况下，日志中显示以下条目：</p>
    <pre><code>
    "Update.job" (update.exe) 3/26/2001 1:15:46 PM ** ERROR **
    The attempt to log on to the account associated with the task failed, therefore, the task did not run.
    The specific error is
    0x8007052e:Logon failure:unknown user name or bad password.
    Verify that the task's Run-as name and password are valid and try again.
    </code></pre>
    <p>显然，任务中的用户名或密码在此系统中无效。下面的 <strong>schtasks /change</strong> 命令为 Svr01 上的 Update 任务更新用户名和密码：</p>
    <p><strong>schtasks /change /tn Update /s Svr01 /ru Administrator /rp PassW@rd3</strong></p>
    <p>在 <strong>change</strong> 命令完成之后，重新运行 <strong>run</strong> 命令。这一次，Update.exe 程序启动，SchTasks.exe 显示以下消息：</p>
    <pre><code>错误：无法运行计划任务 "Update"。</code></pre>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks end</font></u></a></p>
    <div class=expand><a name=end></a>
    <p>终止由任务启动的程序</p>
    <h2>语法</h2>
    <p><strong>schtasks</strong> <nobr><strong>/end</strong></nobr> <nobr><strong>/tn</strong> <em>TaskName</em></nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr><strong>/?</strong></nobr> </p>
    <h2>参数</h2>
    <dl>
    <dt><strong>/tn</strong> <em>TaskName</em>
    <dd>标识启动程序的任务。该参数是必需的。
    <dt><strong>/s</strong> <em>Computer</em>
    <dd>指定远程计算机（带有或者没有反斜杠）的名称或 IP 地址。默认值是本地计算机。
    <dt><strong>/u</strong> [<em>domain</em>\]<em>user</em>
    <dd>使用特定用户帐户的权限运行命令。默认情况下，使用已登录到运行 SchTasks 的计算机上的用户的权限运行命令。
    <dt><strong>/p</strong> <em>password</em>
    <dd>指定在 <strong>/u</strong> 参数中指定的用户帐户的密码。如果使用 <strong>/u</strong> 参数，则需要该参数。
    <dt><strong>/?</strong>
    <dd>显示帮助。 </dd></dl>
    <h2>注释</h2>
    <ul><noloc><span class=reuse id=s_u_p_remark>XOX</span></noloc>
        <li>SchTasks.exe 只终止由计划任务启动的程序实例。要终止其它程序，请使用 TaskKill。它是一个包含在 Windows XP Professional 中的工具。有关 TaskKill 的详细信息，请参阅 <a id=specLoc href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/taskkill.htm"><u><font color=#0000ff>TaskKill</font></u></a>。 </li>
    </ul>
    <h2>范例</h2>
    <h3>终止本地计算机上的任务</h3>
    <p>下面的命令终止由 My Notepad 任务启动的 Notepad 实例：</p>
    <p><strong>schtasks /end /tn "My Notepad"</strong></p>
    <p>作为响应，SchTasks.exe 终止了由任务启动的 Notepad 实例并显示以下成功消息：</p>
    <pre><code> 成功：计划任务 "My Notepad" 已成功终止。</code></pre>
    <h3>终止远程计算机上的任务</h3>
    <p>下面的命令终止远程计算机 Svr01 上由 InternetOn 任务启动的 Internet Explorer 实例：</p>
    <p><strong>schtasks /end /tn InternetOn /s Svr01</strong></p>
    <p>作为响应，SchTasks.exe 停止由任务启动的 Internet Explorer 实例并显示以下成功消息：
    <pre><code>成功：计划任务 "Update" 正在运行...</code></pre>
    <p>&#160;</p>
    </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks delete</font></u></a></p>
    <div class=expand>
    <p>删除计划任务</p>
    <h2>语法</h2>
    <p><strong>schtasks</strong> <nobr><strong>/delete</strong></nobr> <nobr><strong>/tn</strong> {<em>TaskName</em> | *}</nobr> <nobr>[<strong>/f</strong>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> <nobr>[<strong>/?</strong>]</nobr></p>
    <h2>参数</h2>
    <dl>
    <dt><strong>/tn</strong> {<em>TaskName</em> | *}
    <dd>标识要删除的任务。该参数是必需的。
    <table>
        <tbody>
            <tr>
                <th>值</th>
                <th>说明</th>
            </tr>
            <tr>
                <td><em>TaskName</em></td>
                <td>删除已命名任务。</td>
            </tr>
            <tr>
                <td><em>*</em></td>
                <td>删除计算机上的所有计划任务。</td>
            </tr>
        </tbody>
    </table>
    <dt><strong>/f</strong>
    <dd>阻止确认消息。不警告就删除任务。
    <dt><strong>/s</strong> <em>Computer</em>
    <dd>指定远程计算机的名称或 IP 地址（带有或者没有反斜杠）。默认值是本地计算机。
    <dt><strong>/u</strong> [<em>domain</em>\]<em>user</em>
    <dd>使用特定用户帐户的权限运行命令。默认情况下，使用已登录到运行 SchTasks 的计算机上的用户的权限运行命令。
    <dt><strong>/p</strong> <em>password</em>
    <dd>指定在 <strong>/u</strong> 参数中指定的用户帐户的密码。如果使用 <strong>/u</strong> 参数，则需要该参数。
    <dt><strong>/?</strong>
    <dd>在命令提示符显示帮助。 </dd></dl>
    <h2>注释</h2>
    <ul><noloc><span class=reuse id=s_u_p_remark>XOX</span></noloc>
        <li><strong>delete</strong> 操作从计划表中删除任务。它不删除任务运行的程序或中断正在运行的程序。
        <li><strong>delete *</strong> 命令删除所有为计算机计划的任务，而不是仅删除由当前用户计划的任务。 </li>
    </ul>
    <h2>范例</h2>
    <h3>从远程计算机上的计划表中删除任务</h3>
    <p>下面的命令从远程计算机上的计划表中删除 "Start Mail" 任务。它使用 <nobr><strong>/s</strong></nobr> 参数来标识远程计算机。</p>
    <p><nobr><strong>schtasks /delete /tn "Start Mail" /s Svr16</strong></nobr></p>
    <p>作为响应， SchTasks.exe 显示以下确认消息。要删除任务，请键入 <strong>y</strong>。要取消命令，请键入 <strong>n</strong>：</p>
    <pre><code>警告您确定要删除任务 "Start Mail" 吗 (Y/N )? <strong>y</strong>
    成功:已成功删除计划任务 "Start Mail"。</code></pre>
    <h3>删除所有为本地计算机计划的任务。</h3>
    <p>下面的命令从本地计算机的计划表中删除所有的任务，包括由其它用户计划的任务。它使用 <nobr><strong>/tn *</strong></nobr> 参数代表计算机上所有的任务，使用<nobr><strong>/f</strong></nobr> 参数取消确认消息。</p>
    <p><nobr><strong>schtasks /delete /tn * /f</strong></nobr></p>
    <p>作为响应，SchTasks.exe 显示以下成功消息以表明只删除了计划任务 SecureScript。</p>
    <code>成功：计划任务 "SecureScript" 已成功删除。</code> </div>
    <p><a class=expandToggle id=expand href="http://www.haokucn.com/article/Tushu_html/JISHULEI/CMDHELP/schtasks.htm#"><u><font color=#800080>schtasks query</font></u></a></p>
    <div class=expand>
    <p>显示计划在计算机上运行的所有任务，包括那些由其它用户计划的任务。</p>
    <h2>语法</h2>
    <p><strong>schtasks</strong> <nobr>[<strong>/query</strong>]</nobr> <nobr>[<strong>/fo</strong> {<strong>TABLE</strong> | <strong>LIST</strong> | <strong>CSV</strong>}]</nobr> <nobr>[<strong>/nh</strong>]</nobr> <nobr>[<strong>/v</strong>]</nobr> <nobr>[<strong>/s</strong> <em>computer</em> [<strong>/u</strong> [<em>domain</em>\]<em>user</em> <strong>/p</strong> <em>password</em>]]</nobr> </p>
    <h2>参数</h2>
    <dl>
    <dt>[<strong></strong><strong>/query</strong>]
    <dd>操作名称可选。键入不带任何参数的 <strong>schtasks</strong> 来执行查询。
    <dt><strong>/fo</strong> {<strong>TABLE</strong>|<strong>LIST</strong>|<strong>CSV</strong>}
    <dd>指定输出格式。<strong>TABLE</strong> 为默认值。
    <dt><strong>/nh</strong>
    <dd>忽略表格显示中的列标题。此参数与 <strong>TABLE</strong> 和 <strong>CSV</strong> 输出格式共同使用时有效。
    <dt><strong>/v</strong>
    <dd>将任务的高级属性添加到显示中。
    <p>使用 <nobr><strong>/v</strong></nobr> 的查询应该格式化成 <strong>LIST</strong> 或 <strong>CSV</strong>。</p>
    <dt><strong>/s</strong> <em>Computer</em>
    <dd>指定远程计算机的名称或 IP 地址（带有或者没有反斜杠）。默认值是本地计算机。
    <dt><strong>/u</strong> [<em>domain</em>\]<em>user</em>
    <dd>使用特定用户帐户的权限运行命令。默认情况下，使用已登录到运行 SchTasks 的计算机上的用户的权限运行命令。
    <dt><strong>/p</strong> <em>password</em>
    <dd>指定在 <strong>/u</strong> 参数中指定的用户帐户的密码。如果使用 <strong>/u</strong> 参数，则需要该参数。
    <dt><strong>/?</strong>
    <dd>在命令提示符显示帮助。 </dd></dl>
    <h2>注释</h2>
    <ul><noloc><span class=reuse id=s_u_p_remark>XOX</span></noloc>
        <li><strong>query</strong> 操作列出了为计算机计划的所有任务，而不只是由当前用户计划的任务。 </li>
    </ul>
    <h2>范例</h2>
    <h3>显示本地计算机上的计划任务。</h3>
    <p>下面的命令显示为本地计算机计划的所有任务。这些命令得到的结果相同，并可以交换使用。</p>
    <p><nobr><strong>schtasks</strong></nobr></p>
    <p><nobr><strong>schtasks /query</strong></nobr></p>
    <p>作为响应，SchTasks.exe 以默认的简单表格格式显示任务，如下表所示：</p>
    <pre><code>
    TaskName                  Next Run Time             Status
    ========================= ======================== ==============
    Microsoft Outlook         At logon time
    SecureScript              14:42:00 PM ， 2/4/2001
    </code></pre>
    <h3>显示计划任务的高级属性</h3>
    <p>下面的命令要求详细的显示本地计算机上的任务。它使用 <nobr><strong>/v</strong></nobr> 参数来请求详细显示，使用 <nobr><strong>/fo LIST</strong></nobr> 参数来将显示格式化成易于阅读的列表。这个命令可以用来验证创建的任务有预期的循环模式。</p>
    <p><nobr><strong>schtasks /query /fo LIST /v</strong></nobr></p>
    <p>作为响应，SchTasks.exe 显示所有任务的详细属性列表。下面的显示给出了一个计划在每月最后一个周五的 4:00 A.M. 运行的任务的列表：</p>
    <pre><code>
    HostName：RESKIT01
    TaskName:SecureScript
    Next Run Time：4:00:00 AM ， 3/30/2001
    Status:Not yet run
    Last Run Time：Never
    Last Result：                               0
    Creator：user01
    Schedule：At 4:00 AM on the last Fri of every month, starting 3/24/2001
    Task To Run:： C:\WINDOWS\system32\notepad.exe
    Start In:notepad.exe
    Comment:N/A
    Scheduled Task State:Enabled
    Scheduled Type：Monthly
    Modifier：Last FRIDAY
    Start Time4:00:00 AM
    Start Date:                                3/24/2001
    End Date：N/A
    Days:FRIDAY
    Months:JAN、FEB、MAR、APR、MAY、JUN、JUL、AUG、SEP、OCT、NOV、DEC
    Run As User:RESKIT\user01
    Delete Task If Not Rescheduled:Enabled
    Stop Task If Runs X Hours and X Mins:      72:0
    Repeat:Until Time：Disabled
    Repeat:Repeat:Disabled
    Repeat:Stop If Still Running: Disabled
    Idle: Start Time(For IDLE Scheduled Type): Disabled
    Idle: Only Start If Idle for X Minutes: Disabled
    Idle:If Not Idle Retry For X Minutes: Disabled
    Idle: Stop Task If Idle State End: Disabled
    Power Mgmt: No Start On Batteries: Disabled
    Power Mgmt:Stop On Battery Mode: Disabled
    </code></pre>
    <h3>将为远程计算机计划的任务记入日志</h3>
    <p>下面的命令请求为远程计算机计划的任务列表，并将任务添加到本地计算机中以逗号分隔的日志文件中。此命令的格式可以用来收集和跟踪为多个计算机计划的任务。</p>
    <p>命令使用 <nobr><strong>/s</strong></nobr> 参数标识远程计算机 Reskit16，使用 <strong>/fo</strong> 参数指定格式，使用 <nobr><strong>/nh</strong></nobr> 参数取消列标题。<strong>&gt;&gt;</strong> 附加符号将输出重定向到本地计算机 Svr01 上的任务日志 p0102.csv。因为命令在远程计算机上运行，所以本地计算机路径必须是完全合格的。</p>
    <p><nobr><strong>schtasks /query /s Reskit16 /fo csv /nh &gt;&gt; \\svr01\data\tasklogs\p0102.csv</strong></nobr></p>
    <p>作为响应，SchTasks.exe 会把为计算机 Reskit16 计划的任务添加到本地计算机 Svr01 上的 p0102.csv 文件中。</p>
    </div>
    <h2>注释</h2>
    <ul>
        <li>SchTasks.exe 执行的操作类似于&#8220;控制面板&#8221;中&#8220;计划任务&#8221;中的操作。可以使用两种工具中的任一种来创建、删除、配置或显示计划任务。
        <li>键入不带任何参数的 <strong>schtasks</strong> 执行查询。
        <li>用户必须是命令起作用的计算机上的 Administrators 组的成员。
        <li>要确认计划运行或要找出计划不运行的原因，请查看&#8220;任务计划&#8221;服务事务日志 <em>Systemroot</em>\SchedLgU.txt。该日志记录了由包括&#8220;计划任务&#8221;和 SchTasks.exe 在内的所有使用该服务的工具启动的尝试运行。
        <li>损坏任务文件的情况极少发生。已损坏文件不会运行。在已损坏任务上试图执行某项操作时，SchTasks.exe 显示以下错误消息：
        <pre><code>错误：数据非法。</code></pre>
        <p>已损坏任务无法恢复。要恢复系统的计划任务特征，请使用 SchTasks.exe 或&#8220;计划任务&#8221;从系统中删除任务并重新计划。</p>
        <li>SchTasks.exe 取代了包含在 Windows 早期版本中的工具 At.exe。 </li>
    </ul>
    <noloc><span class=reuse id=cmdformat>XOX</span></noloc><img src ="http://www.cppblog.com/colys/aggbug/29642.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-08-09 14:10 <a href="http://www.cppblog.com/colys/articles/29642.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>更改IE和FireFox收藏夹的路径</title><link>http://www.cppblog.com/colys/articles/24234.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Wed, 16 May 2007 10:41:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/24234.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/24234.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/24234.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/24234.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/24234.html</trackback:ping><description><![CDATA[/*======================================= IE===============================================*/<br><br>默认情况下收藏夹的路径为：C:\Documents and Settings\Administrator（用户名）\Favorites <br>要更改收藏夹的路径可以，打开注册表： <br>HKEY_USERs\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders&#8221;,而后把&#8220;Favorites&#8221;键值(%USERPROFILE%\Favorites)修改成你想要设的收藏夹路径即可！<br><br><br>/*======================================= Firefox===============================================*/<br><br>打开firefox，地址栏输入about:config
<br>右键新建一个字符串，名为 browser.bookmarks.file
<br>然后输入字串值为&#8220;新路径名\书签文件名&#8221;即可。比如 D:\My bookmarks\bookmarks.html<br><img src ="http://www.cppblog.com/colys/aggbug/24234.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-05-16 18:41 <a href="http://www.cppblog.com/colys/articles/24234.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vista中添加IIS7.0和管理ASP程序的方法。</title><link>http://www.cppblog.com/colys/articles/23484.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Sun, 06 May 2007 01:21:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/23484.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/23484.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/23484.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/23484.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/23484.html</trackback:ping><description><![CDATA[<div>IIS7的安装方法和以往所有的安装方法都不一样。<br><br>首先点击&#8220;开始&#8221;--&gt;&#8220;控制面板&#8221;--&gt;&#8220;程序&#8221;--&gt;&#8220;程序和功能&#8221;--&gt;&#8220;打开或关闭Windows功能&#8221;,<br><br>在打开的&#8220;Windows功能&#8221;窗口中的&#8220;Internet信息服务&#8221;下拉菜单中的&#8220;Web管理工具&#8221;和&#8220;万维网服务&#8221;这两个选项中，拉开仔细勾选，特别是&#8220;万维网服务&#8221;--&gt;&#8220;应用程序开发功能&#8221;中的选项要仔细勾选。如果要配置PHP，那么一定要勾选上&#8220;ISAPI扩展&#8221;这个选项。勾选完了以后，就可以点击&#8220;确定&#8221;按钮了，并不需要插入Vista的安装盘，这和Vista的安装机制有关，就不再详细介绍了。<br><br>安装完成以后，可以用组合键&#8220;Win＋R&#8221;打开运行窗口，输入mmc，打开&#8220;Windows 管理控制平台&#8221;，点击&#8220;文件&#8221;--&gt;&#8220;添加/删除管理单元&#8221;，选择&#8220;Internet信息服务&#8221;，然后点击&#8220;添加&#8221;按钮。<br><br>或者直接点击&#8220;控制面板&#8221;--&gt;&#8220;系统和维护&#8221;--&gt;&#8220;管理工具&#8221;--&gt;&#8220;Internet信息服务（IIS）管理器&#8221;。<br><br>打开的IIS 7和IIS 6截然不同，虽然布局相似。IIS7没有站点没有&#8220;属性&#8221;选项卡，而所有的操作，都在右侧的菜单中。<br><br>如果网站的程序是IIS的，而磁盘格式是NTFS。首先在选择IIS 7左侧框架中的默认的网站图标，在右侧的菜单中，选择&#8220;基本设置&#8221;，定义到网站程序所在的磁盘位置。打开&#8220;我的电脑&#8221;，到网站程序所在的文件夹，点击鼠标左键，选择&#8220;安全&#8221;选项卡，把&#8220;只读&#8221;属性去掉，然后添加&#8220;Authenticated&nbsp;Users&#8221;的所有权限。<br><br>如果是IIS 6你进行到这一步，那么已经基本上设置成功了，但是打开IE，输入&#8220;localhost/index.asp&#8221;，发现没有读数据库，TMMD，还要继续！<br><br>首先设置应用程序池(Application&nbsp;Pool)为Classic&nbsp;.NET&nbsp;AppPool（不分大小写），<br><br>然后给&#8220;系统盘:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp&#8221;目录权限中添加一个&#8220;Authenticated Users&#8221;用户，将Authenticated Users的权限中的完全控制打开。<br>这里需要注意的是AppData目录是隐藏的，还需要选择&#8220;工具&#8221;--&gt;&#8220;文件夹选项&#8221;--&gt;&#8220;查看&#8221;--&gt;&#8220;显示隐藏的文件和文件夹&#8221;才行。因为MS&nbsp;Jet引擎改变了临时目录的位置，但是又没有对临时的存取权限，导致数据库使用失败。<br><br>此时就大功告成了。<br><br>有一种情况要特别注意，就是磁盘格式是NTFS，而系统开启了两个账户，一个账户是administrator1，另一个是administrator2，某一个盘，administrator1不想administrator2访问，就只给了administrator1的访问权限，结果系统重装，忘记把访问权限恢复过来，重装后把自己锁死。一定要非常重视权限问题设置问题，避免不必要的麻烦。</div><img src ="http://www.cppblog.com/colys/aggbug/23484.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-05-06 09:21 <a href="http://www.cppblog.com/colys/articles/23484.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows远程控制端口修改</title><link>http://www.cppblog.com/colys/articles/23347.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Wed, 02 May 2007 15:33:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/23347.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/23347.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/23347.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/23347.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/23347.html</trackback:ping><description><![CDATA[<p>在注册表中找到Hkey_local_machine\system\currentcontrolset\control\terminal server\wds\repwd\tds\tcp 其下的portnumber值从3389修改为需要的数字<br>hkey_local_machine\system\currentcontrolsetcontrol\terminal server\WINSTATIONS\RDP-TCP,将其下的portnumber值 同时进行修改</p><img src ="http://www.cppblog.com/colys/aggbug/23347.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-05-02 23:33 <a href="http://www.cppblog.com/colys/articles/23347.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Takeown还我文件所有权</title><link>http://www.cppblog.com/colys/articles/23135.html</link><dc:creator>colys</dc:creator><author>colys</author><pubDate>Sat, 28 Apr 2007 12:19:00 GMT</pubDate><guid>http://www.cppblog.com/colys/articles/23135.html</guid><wfw:comment>http://www.cppblog.com/colys/comments/23135.html</wfw:comment><comments>http://www.cppblog.com/colys/articles/23135.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/colys/comments/commentRss/23135.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/colys/services/trackbacks/23135.html</trackback:ping><description><![CDATA[<div>经常会遇到这样的情况，打开某个文件，&#8220;您无权访问&#8221;</div>
<div>什么，无权访问，老大，我是管理员啊，我都无权访问，晕，于是要修改文件的读取权限，但是很多时候你会发现你丢失的是文件的所有权，二话不说，你会选择把所有权改为自己。</div>
<div>但是如果是网络上大批的电脑怎么办，不会又要来回跑吧，不用，呵呵，windows 2003 带了一个工具叫做takeown被偶 发现了</div>
<div>看看它的语法，而且copy到windows xp的机器上也一样好用，怎么样写个脚本搞定了吧</div>
<div>如果你还要修改权限列表ACL，windows xp都带了一个命令叫做cacls，OK.赶快夺回你的文件所有权吧&nbsp;&nbsp;&nbsp; ^_^&nbsp;&nbsp;</div>
<div>
<h1><font style="background-color: #0a246a;" color="#ffffff">Takeown</font></h1>
<p>使管理员成为文件的所有者，可授予管理员恢复对以前被拒绝的文件的访问权限。
</p>
<h2>语法</h2>
<p><strong><font style="background-color: #0a246a;" color="#ffffff">takeown</font></strong> [<strong>/s</strong> <em>Computer</em> [<strong>/u</strong> [<em>Domain</em><strong>\</strong><em>User</em> [<strong>/p</strong> [<em>Password</em>]]]] <strong>/f</strong> <em>FileName</em> [<strong>/a</strong>] [<strong>/r</strong>] [<strong>/d</strong> {Y | N}]
</p>
<h2>参数</h2>
<dl><dt><strong>/s</strong> <em>Computer</em>
</dt><dd>指定远程计算机名称或 IP 地址（不能使用反斜杠）。该默认值是本地计算机。此参数适用于在命令中指定的所有文件和文件夹。
</dd><dt><strong>/u</strong> <em>Domain</em><strong>\</strong><em>User</em>
</dt><dd>使用特定用户帐户的权限运行脚本。该默认值是系统权限。
</dd><dt><strong>/p</strong> [<em>Password</em>]
</dt><dd>指定 <strong>/u</strong> 参数中指定的用户帐户的密码。
</dd><dt><strong>/f</strong> <em>FileName</em>
</dt><dd>指定文件名或目录名样式。在指定样式中可以使用通配符&#8220;*&#8221;。此外，还可使用 <em>ShareName\FileName</em>。
</dd><dt><strong>/a</strong>
</dt><dd>为 Administrators 组而不是当前用户赋予所有权。
</dd><dt><strong>/r</strong>
</dt><dd>对指定目录和子目录中的所有文件执行递归操作。
</dd><dt><strong>/d</strong> {Y | N}
</dt><dd>当前用户没有查看目录内的文件夹的权限时使用的默认提示。使用 Y 获取所有权，使用 N 取消确认提示。 </dd></dl>
<h2>注释</h2>
<ul>
    <li>要执行该过程，您必须是本地计算机 <a><u><font color="#0000ff">Administrators</font></u></a> 组的成员，或者您必须被<a title="查看定义"><u><font color="#0000ff">委派</font></u></a>适当的权限。如果将计算机加入域，<a><u><font color="#0000ff">Domain Admins</font></u></a> 组的成员可能也可以执行这个过程。作为安全性的最佳操作，可以考虑使用<a><u><font color="#0000ff">运行方式</font></u></a>来执行这个过程。
    </li>
    <li>该命令通常在批处理文件中使用。
    </li>
    <li>使用 <strong>/s</strong>、<strong>/u</strong> 和 <strong>/p</strong> 命令行选项<br><br>只有在使用 <strong>/s</strong> 命令行选项时才可使用 <strong>/u</strong> 和 <strong>/p</strong> 选项。必须同时使用 <strong>/p</strong> 和 <strong>/u</strong> 才能提供用户密码。
    </li>
    <li>如果不指定 <strong>/a</strong>，将为当前登录到计算机上的用户赋予所有权。
    </li>
    <li>不支持问号 (?) 和通配符 (*) 混合使用。
    </li>
    <li>如果在安装了另一个 Windows Server&nbsp;2003 操作系统的计算机上安装 Windows Server&nbsp;2003
    操作系统，然后尝试删除它，则不能删除整个目录。其中一个名为 \Installer 的隐藏目录包含一些锁定的 .msi 和 .ico
    文件，必须格式化驱动器才能删除它们。这是因为 Windows Server&nbsp;2003 操作系统向该文件应用安全属性，以便只有以前安装的
    System 帐户可访问这些文件。甚至该计算机的管理员也不能重置这些权限。必须运行 <strong><font style="background-color: #0a246a;" color="#ffffff">takeown</font></strong> 才能删除这些文件。
    </li>
    <li>使用 <strong><font style="background-color: #0a246a;" color="#ffffff">takeown</font></strong> 删除锁定后，可能必须使用 Windows 资源管理器或 <strong>cacls</strong> 为您赋予对于这些文件和目录的完全权限，之后，您才能将其删除。有关 <strong>cacls</strong> 的详细信息，请参阅&#8220;相关主题&#8221;。 </li>
</ul>
<h2>示例</h2>
<p>要使用名称样式 Lostfile 获取文件所有权，应键入：
</p>
<p><strong><font style="background-color: #0a246a;" color="#ffffff">takeown</font> /f lostfile</strong>
</p>
</div>
<br><img src ="http://www.cppblog.com/colys/aggbug/23135.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/colys/" target="_blank">colys</a> 2007-04-28 20:19 <a href="http://www.cppblog.com/colys/articles/23135.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>