2010年7月23日星期五

Install XP/Windows 7 by command line

硬盘安装XP的实用方法:
用WINPE x86/x64启动, 运行:
winnt32.exe /syspart:c /tempdrive:c /makelocalsource

硬盘安装windows7:
1、imagex /apply d:\sources\install.wim 5 c: (注意,这里5是指ultimate版,要装其它版本把这个数字换成其它)
2、bcdboot c:\windows /s e: /l zh-CN (一条命令搞定bootmgr和bcd,并把启动菜单设成中文的)
3、bootsect /nt60 e: (写入c:盘的bootmgr引导扇区)   
启动即可继续安装.


硬盘安装windows7的高级实用方法:
1、把镜像用虚拟光驱加载,然后拷贝到任一硬盘分区中,我的是E:\windwos7。  


2、把E:\windwos7目录下的bootmgr和boot目录(其实只要里面的boot.sdi和bcd文件)拷贝到c盘根目录下,并在C盘根目录下建个sources文件夹。(原系统是vista的话需要取得权限,覆盖相应文件,取得权限的方法参照vista区的vista优化大师的右键取得管理权限法)  

3、把E:\windwos7\sources下的boot.win复制到C盘下sourse文件夹。  

4、用管理员身份运行cmd,然后输入c:\boot\bootsect.exe /nt60 c:

(注意,此处bootsect在c:\boot目录下),然后提示successful(即成功了!)
再将系统盘的卷名称改为英文:本地磁盘--bdcp  

5、重启计算机,正在启动安装程序  

6、安装程序启动,选择你要安装的语言类型,同时选择适合自己的时间和货币显示种类及键盘和输入方式。  

7、出现“开始安装界面”,(要注意了,不点击“现在安装”)点左下角“修复计算机”(repair my computer)。  

8、进入“系统恢复选项”,选择最后一项“命令提示符”(command prompt),进入DOS窗口。

9、执行格式化命令format c:/q(注:如C盘是FAT32格式,想转NTFS格式的话,执行format c:/fs:ntfs)。
注:此步可能需要输入卷的名称bdcp  

10、安装系统,输入E:windwos7sourcessetup.exe(注意文件路径是在E盘的windwos7文件夹下的sources文件里),之后就是正常的安装了。

2010年7月13日星期二

Visual Studio 2005 Remote Debugging to Vista and Windows 7

When you run MSVSMON.EXE on Vista and Windows 7, do you get the dreaded message indicating that you need to set the firewall, but when you do, MSVSMON.EXE errors out with an Incorrect Function message? After much struggle, I finally found the trick to remote debugging working correctly. Many thanks to this post on the MSDN Forums from Sam George.

It seems that even with the Vista SP1 Update, MSVSMON.EXE does not properly set the firewall. You'll need to set it up manually with the following batch file:


netsh advfirewall firewall add rule name="Microsoft Visual Studio Remote Debugger - UDP 137" dir=in action=allow enable=yes localport=137 protocol=udp

netsh advfirewall firewall add rule name="Microsoft Visual Studio Remote Debugger - UDP 138" dir=in action=allow enable=yes localport=138 protocol=udp

netsh advfirewall firewall add rule name="Microsoft Visual Studio Remote Debugger - TCP 139" dir=in action=allow enable=yes localport=139 protocol=tcp

netsh advfirewall firewall add rule name="Microsoft Visual Studio Remote Debugger - TCP 445" dir=in action=allow enable=yes localport=445 protocol=tcp

Of course, make sure you run the batch file from an elevated command prompt.

2010年7月1日星期四

无法解析外部符号 __security_cookie

1)选择“项目”-》“属性”-》“C/C++”-》“代码生成”-》“缓冲区安全检查”,设为“否”


2)选择“项目”-》“属性”-》“链接器”-》“输入”-》“附加依赖项”,增加”bufferoverflowU.lib”

http://support.microsoft.com/kb/894573.