星期二, 4月 24, 2007

clear Windows

@echo off
echo 正在清除系統垃圾檔案中,請稍候......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*.syd
del /f /s /q %systemdrive%\*.---
del /f /s /q %systemdrive%\*.$$$
del /f /s /q %systemdrive%\*.@@@
del /f /s /q %systemdrive%\*.??$
del /f /s /q %systemdrive%\*.??~
del /f /s /q %systemdrive%\*.~*
del /f /s /q %systemdrive%\*.err
del /f /s /q %systemdrive%\*log.txt
del /f /s /q %systemdrive%\*.prv
del /f /s /q %systemdrive%\*.wbk
del /f /s /q %systemdrive%\*.xlk
del /f /s /q %systemdrive%\*.diz
del /f /s /q %systemdrive%\*.dmp
del /f /s /q %systemdrive%\mscreate.dir
del /f /s /q %systemdrive%\chklist.*
del /f /s /q %systemdrive%\*.ftg
del /f /s /q %systemdrive%\*.fts
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
DEL /S /F /Q "%systemroot%\Temp\*.*"
DEL /S /F /Q "%AllUsersProfile%\「開始」功能表\程式集\Windows Messenger.lnk"
RD /S /Q %windir%\temp & md %windir%\temp
RD /S /Q "%userprofile%\Local Settings\Temp"
MD "%userprofile%\Local Settings\Temp"
RD /S /Q "%systemdrive%\Program Files\Temp"
MD "%systemdrive%\Program Files\Temp"
RD /S /Q "%systemdrive%\d"
net user aspnet /delete
echo 清除系統垃圾檔案完成!
echo. & pause

星期一, 4月 02, 2007

Extern How?

全域吃透透寫法
a.h

extern double someVar;

a.cpp

#include
#include "a.h"
#include "c.h"
using namespace std;

int main() {
cout << someVar << endl;
test();
return 0;
}


b.cpp

#include "aaa.h"
double someVar = 1000;


c.h

void test();


c.cpp
#include
#include "aaa.h"

using namespace std;
#include "aaa.h"
void test() {
cout << someVar << endl;

}



就可以讓其他檔案也吃透透了,要非常小心這樣的用法,當程式數萬行之後,很容易把自己搞混。小心用。