2010-04-28

net share x /delete提示系统错误5

虽然用户已经是管理员权限,但是不行。
在 命令提示符 点击右键,选择 以管理员身份运行,那么再net share x /delete就可以了。

2010-04-25

Windows 7搜索zip文件

在Windows XP,缺省会自动搜索zip文件的内容。
在Windows 7,缺省不搜索压缩文件。
如何打开:资源管理, 组织 -> 文件夹和搜索选项 (或者按一下Alt,就跟XP一样了:工具 (Tools) -> 文件夹选项 (Folder Options)),然后在 文件夹选项 对话框中切换到 搜索(Search tab) ,把 包括压缩文件(Include compressed files) 选上即可。
Windows 7不仅搜索zip,还包括rar等。

Crimson Editor

一个小众的文本编辑器,免费(且现在开源)。
除了一般文本编辑器的语法高亮、正规表达式查找、多文件编辑等特性外,其在目录中查找文件的速度比其他很多软件快很多,加之简洁、易用性好(没有怪异的热键等)等,所以我一直在用。
新版本(SVN263等;今天我还试了最新的SVN286;)在Windows 7最近有UAC问题。
看到论坛上有人讨论,提到可以使用3.70版本(是Emerald Editor Community接管之前的最后一个官方正式版)。果然,没有UAC问题。

2010-04-23

Windows下使用ls

Linux用多了,Windows命令行也习惯ls。
要达到这个目的,方法很多。我是这样做的:
修改命令行的快捷方式的目标为C:\Windows\System32\cmd.exe /k "doskey ls=dir",这样通过快捷方式启动命令行时ls就是一个值为dir的宏。

2010-04-22

[zz]grep如何递归目录并在指定类型文件中查找?

直观做法:grep -R "hello" *.c
但会提示*.c文件不存在

正确方法: find . -iname "*.c" -exec grep "hello" {} \;
如果要看文件名,加上-H

2010-04-20

从VC6移植到VS2008

错误1:_WIN32_WINNT settings conflicts with _WIN32_IE setting
解决方法:http://connect.microsoft.com/VisualStudio/feedback/details/455721/cant-compile-due-to-issues-with-preprocessor-constants
To fix this problem, make your stdafx.h file look like this:
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER// Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0501// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.