﻿<?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>IT博客-工作笔记-随笔分类-文章摘抄</title><link>http://www.cnitblog.com/guhaiyun/category/6982.html</link><description>--Henry@Moliyo_2008</description><language>zh-cn</language><lastBuildDate>Tue, 11 Oct 2011 05:12:45 GMT</lastBuildDate><pubDate>Tue, 11 Oct 2011 05:12:45 GMT</pubDate><ttl>60</ttl><item><title>instsrv.exe——来自Windows 2000 Resource Kits的一个小工具</title><link>http://www.cnitblog.com/guhaiyun/archive/2008/03/25/41440.html</link><dc:creator>Henry</dc:creator><author>Henry</author><pubDate>Tue, 25 Mar 2008 06:42:00 GMT</pubDate><guid>http://www.cnitblog.com/guhaiyun/archive/2008/03/25/41440.html</guid><wfw:comment>http://www.cnitblog.com/guhaiyun/comments/41440.html</wfw:comment><comments>http://www.cnitblog.com/guhaiyun/archive/2008/03/25/41440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/guhaiyun/comments/commentRss/41440.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/guhaiyun/services/trackbacks/41440.html</trackback:ping><description><![CDATA[<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">微软官方对该小工具的说明：<br>Installs and uninstalls executable services and assigns names to them.</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">显而易见，这个小工具是用以安装和卸载可执行的服务和指派服务名给这些可执行的服务的。</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">那么怎么去使用呢？这里我们设定要将F:\cpu.exe 以 CPUSrv 的名称显示作为服务的话，我们应当这样子做：<br>先将instsrv.exe放入任意目录，我们有两种办法来执行这个命令</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">A、CMD法</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">1、单击『开始』菜单中的【运行】并键入&#8220;cmd&#8221;（不包括双引号）后单击【确定】按钮<br>2、在CMD中使用 cd 命令进入 instsrv.exe 所在目录或者直接输入 instsrv.exe 具体路径。比如 instsrv.exe 在F:\Tools目录下的话，我们应该这样子做：<br>键入 cd f:\tools 后回车进入该目录<br>键入 instsrv CPUSrv f:\cpu.exe 回车即可<br>或者也可以<br>直接键入 f:\tools\instsrv.exe CPUSrv f:\cpu.exe 后回车即可<br>3、安装了服务，但此时服务并未启动，我们可以使用 Net 命令来启动服务<br>依旧在CMD中<br>键入 net start CPUSrv 后回车即可<br>4、启动了服务，我们还可以设置服务启动类型<br>依旧在CMD中<br>键入 sc config CPUSrv start= auto&nbsp;&nbsp;&nbsp;&nbsp; 自动启动方式<br>键入 sc config CPUSrv start= demand&nbsp;&nbsp; 手动启动方式<br>键入 sc config CPUSrv start= disabled 已禁止启动方式</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">B、GUI法</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">1、单击『开始』菜单中的【运行】<br>2、在【运行】文本框中键入<br>f:\tools\instsrv.exe CPUSrv f:\cpu.exe<br>后单击【确定】按钮</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">3、安装了服务，启动服务<br>单击『开始』菜单中的【运行】并键入&#8220;Services.msc&#8221;（不包括双引号）后单击【确定】按钮<br>4、在【服务】中的名为 CPUSrv 的服务上右击即可执行 启动&#167;停止&#167;重新启动 等菜单命令。双击进入即可设置启动类型。</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><br>如果我们要删除这个服务，按照上述步骤，我们执行<br>instsrv.exe CPUSrv REMOVE<br>即可删除该服务</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><strong>注：不要用该工具删除系统有关服务！</strong></p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><br>我们也可以用这个小工具创建一个服务，并设定以某帐户登录启动该服务，命令格式：<br>instsrv CPUSrv F:\cpu.exe -a your account name -p password</p>
<img src ="http://www.cnitblog.com/guhaiyun/aggbug/41440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/guhaiyun/" target="_blank">Henry</a> 2008-03-25 14:42 <a href="http://www.cnitblog.com/guhaiyun/archive/2008/03/25/41440.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>重装grub的方法及GRUB相关配置</title><link>http://www.cnitblog.com/guhaiyun/archive/2008/03/21/41327.html</link><dc:creator>Henry</dc:creator><author>Henry</author><pubDate>Fri, 21 Mar 2008 13:49:00 GMT</pubDate><guid>http://www.cnitblog.com/guhaiyun/archive/2008/03/21/41327.html</guid><wfw:comment>http://www.cnitblog.com/guhaiyun/comments/41327.html</wfw:comment><comments>http://www.cnitblog.com/guhaiyun/archive/2008/03/21/41327.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/guhaiyun/comments/commentRss/41327.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/guhaiyun/services/trackbacks/41327.html</trackback:ping><description><![CDATA[<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">当我们每次要重装WIN的时候,MBR都会被重写,这样原来的GRUB或LILO就会不见了,</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">或者由于某些原因使得原来的GRUB不见了,这个时候只要重装GRUB就行了</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">GRUB的重装方法有很多，这种方法不行，换一种试下</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">1.用安装光盘启动,选升级安装,再只选安装GRUB行了.</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">2.用安装光盘启动,到BOOT那里输入linux rescue<br>也就是进入求援模式，到出现#命令提示符时，输入chroot /mnt/sysimage<br>然后再输入grub-install /dev/hda</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">3.没有软驱如何修复grub/lilo引导菜单？<br>a.把第一张linux安装盘里的dosutils目录复制到windows盘中。如果是iso可以用</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">winrar3提取。<br>b.进入纯dos，进入dosutils目录，执行loadlin autoboot/vmlinuz </p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">root=/dev/hdxx()hdxx是你的linux根分区。这样就能进入linux。<br>c.执行grub-install /dev/hdx(x=a,b,c,d) 或lilo即可以重写引导。</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">4.如果你用grub来引导linux和windows,当windows出毛病重新安装后,会破坏MBR</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">中的grub,这时需要恢复grub.<br>a.把linux安装光盘的第一张放到光驱，然后重新启动机器，在BOIS中把系统用光</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">驱来引导。<br>b.等安装界面出来后，按［F4］键，也就是linux rescue模式。<br>c.一系列键盘以及几项简单的配制，过后就［继续］了。。。这个过程，我不说</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">了，比较简单。<br>d.然后会出现这样的提示符:<br>sh#<br>e.我们就可以操作GRUB了.输入grub:<br>sh#grub<br>会出现这样的提示符:<br>grub&gt;<br>我们就可以在这样的字符后面，输入:<br>grub&gt;root (hdX,Y)<br>grub&gt;setup (hd0)<br>如果成功会有一个successful......<br>这里的X，如果是一个盘，就是0，如果你所安装的linux的根分区在第二个硬盘上</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">，那X就是1了；Y，就是装有linux系统所在的根分区。 setup (hd0)就是把GRUB</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">写到硬盘的MBR上。<br>另外说下,有人说我没安装光盘啊?我是从硬盘安装的.呵呵,那你的ISO文件还在吧</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">..那再来次硬盘安装进入安装界面也是一样的....</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">5.如何把GRUB或LILO删掉?<br>只要在DOS下执行FDISK /MBR就行了...<br>如何配置grub？<br>修改/boot/grub/grub.conf文件。其中<br>&#8220;default=n&#8221;(n是个数字)是grub引导菜单默认被选中的项，n从0开始，0表示第</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">一项，1表示第二项，依此类推。<br>&#8220;timeout=x&#8221;(x是一个数)是超时时间，单位是妙。也就是引导菜单显示后，如</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">果x秒内用户不进行选择，那么grub将启动默认项。<br>&#8220;splashimage =xxxxxx&#8221;，这是引导菜单的背景图，先不理他。<br>其它常用项我用下面的例子来说明：<br>title Red Hat 8.0<br>root (hd1,6)<br>kernel /boot/vmlinuz-2.4.18-14 ro root=/dev/hdb7<br>initrd /boot/initrd-2.4.18-14.img<br>其中"Red Hat 8.0"是在启动菜单列表里显示的名字<br>root (hdx,y)用来指定你的boot分区位置，如果你没有分boot分区（本例就没分</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">boot分区），那就指向根分区就行了，hdx是linux所在硬盘，hd0是第一块硬盘，</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">hd1是第二块，依此类推。y是分区位置，从0开始，也就是等于分区号减一，比如</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">你要指向的分区是hdx7，那么y就是6，如果是hdx1，那y就是0。注意root后面要</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">有一个空格。<br>kernel /boot/vmlinuz-2.4.18-14，其中"/boot/vmlinuz-2.4.18-14"是你要用的</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">内核路径，如果你编译了心内核，把它改成你的新内核的路径就行了。<br>ro就不用管，写上不会有错。<br>root=/dev/hdxx指定根分区，本例是hdb7，所以root=/dev/hdb7<br>initrd xxxxxxxxxxxxx这行不要也行，目前我还不清楚它是做什么用的。<br>上面是linux的，下面是windows的<br>title windows 98<br>rootnoverify (hd0,0)<br>chainloader +1<br>title xxxxxxx不用解释了，上面有解释。<br>rootnoverify (hdx,y)用来指定windows所在分区，x，y跟上面一样，注意</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">rootnoverify后有空格。<br>chainloader +1照抄就行，注意空格</p>
<img src ="http://www.cnitblog.com/guhaiyun/aggbug/41327.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/guhaiyun/" target="_blank">Henry</a> 2008-03-21 21:49 <a href="http://www.cnitblog.com/guhaiyun/archive/2008/03/21/41327.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>