Win7 Temp變數預設定

使用者變數 TEMP、TMP
%USERPROFILE%\AppData\Local\Temp

系統變數 TEMP、TMP
%SystemRoot%\TEMP

IIS Express 相關設定

appcmd.exe 路徑

"C:\Program Files\IIS Express\appcmd.exe"

啟動WebSite

"C:\Program Files\IIS Express\iisexpress.exe" /site:DemoSite

列表WebSite

appcmd.exe list site

刪除WebSite

appcmd.exe delete site "WebSite"

設定WebSite對外IP

  1. 開啟 %homepath%\Documents\IISExpress\config\applicationhost.config
  2. 修改<binding protocol="http" bindingInformation="*:8080:192.168.1.10" />

Notepad2(mod) 相關設定

@echo off
title Notepad2-mod (新增/刪除右鍵選單)
echo.
SET /P ST=輸入y新增右鍵選單,輸入n刪除右鍵選單:
if /I "%ST%"=="y" goto Add
if /I "%ST%"=="n" goto Remove
:Add
reg add "HKEY_CLASSES_ROOT\*\shell\NotePad2" /ve /t REG_SZ /d "用 &NotePad2 打開" /f
reg add "HKEY_CLASSES_ROOT\*\shell\NotePad2\command" /ve /t REG_SZ /d "\"%~dp0Notepad2.exe\" ""%%1""" /f
exit
:Remove
reg delete "HKEY_CLASSES_ROOT\*\shell\NotePad2" /f
exit
view raw ContextMenu.bat hosted with ❤ by GitHub
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Notepad2]
[HKEY_CLASSES_ROOT\*\shell\Notepad2\command]
@="notepad.exe %1"
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\Notepad2]
@echo off
title Notepad2-mod (替換/恢復系統記事本)
echo.
SET /P ST=輸入y替換系統記事本,輸入n恢復系統記事本:
if /I "%ST%"=="y" goto Replace
if /I "%ST%"=="n" goto Restoration
:Replace
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%~dp0Notepad2.exe\" /z" /f
exit
:Restoration
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f
exit

Add "Open with Notepad" to the Context Menu for All Files 替換∕恢復系統記事本.bat & 添加∕刪除右鍵菜單.bat

replace space in filename/folder

@ECHO OFF
SETLOCAL EnableDelayedExpansion
FOR /R %%i IN (*.zip) DO (
SET NewName=%%~nxi
SET NewName=!NewName: =_!
REN "%%i" "!NewName!"
ECHO !NewName!
)
PAUSE
@ECHO OFF
SETLOCAL EnableDelayedExpansion
FOR /D %%i IN ("E:\test22\*") DO (
SET NewName=%%~nxi
SET NewName=!NewName:AVI=!
REN "%%i" "!NewName!"
ECHO !NewName!
)
PAUSE

Pushbullet API (nodejs/vb.net/jQuery)

$.ajax({
url: 'https://api.pushbullet.com/v2/pushes',
type: 'post',
data: {
type: 'note',
title: '安桌椅測試 from jQuery',
body: 'あいうえお'
},
headers: {
Authorization: 'Bearer <your_access_token_here>'
},
dataType: 'json',
success: function(data) {
console.dir(data);
}
});
view raw jq.js hosted with ❤ by GitHub
var request = require('request'),
token = '<your_access_token_here>';
request({
method: 'POST',
uri: 'https://api.pushbullet.com/v2/pushes',
headers: {
Authorization: 'Bearer' + token
},
form: {
type: 'note',
title: '安桌椅測試 from nodejs',
body: 'あいうえお'
}
}, function(error, response, body) {
if (error) {
console.log(response.statusCode);
throw error;
} else {
console.log(body);
}
});
// list Devices
request({
method: 'GET',
uri: 'https://api.pushbullet.com/v2/devices',
headers: {
Authorization: 'Bearer ' + token
},
}, function(error, response, body) {
if (error) {
console.log(response.statusCode);
throw error;
} else {
var j = JSON.parse(body),
devices = j.devices;
for (var i = 0; i < devices.length; i++) {
console.log('%s => %s', devices[i].nickname, devices[i].iden);
}
}
});
//push to a specific device
request({
method: 'POST',
uri: 'https://api.pushbullet.com/v2/pushes',
headers: {
Authorization: 'Bearer ' + token
},
form: {
device_iden: 'xxxxxxxxxxxxxxxxxxxx',
type: 'link',
title: myTitle,
url: myURL
}
}, function(error, response, body) {
if (error) {
throw error;
} else {
//console.log(body);
}
});
view raw nodejs.js hosted with ❤ by GitHub
$token = "<your_access_token_here>"
$postParams = @{ iden = $iden;
type = "note";
title = "This is TITLE";
body = "This is BODY";
}
$req = Invoke-WebRequest -Uri "https://api.pushbullet.com/v2/pushes" `
-Method Post `
-Headers @{"Authorization" = "Bearer $($token)"} `
-Body $postParams
Write-Host "[Pushbullet Send] $($req.StatusDescription) ($($req.StatusCode))"
$token = "<your_access_token_here>"
$iden = "<your_device_id_here>"
$pass = ConvertTo-SecureString "none" -AsPlainText -Force
$auth = New-Object System.Management.Automation.PSCredential ($token, $pass)
$url = "https://api.pushbullet.com/v2/pushes";
$data = @{ iden = $iden
type = "note"
title = "This is TITLE";
body = "This is BODY";
}
Invoke-RestMethod -Method POST -Uri $url -Credential $auth -UseBasicParsing -ErrorAction SilentlyContinue -Body $data | Out-Null
Write-Host "[Pushbullet Send] Done"
Using wc As New WebClient
Try
Dim para As New NameValueCollection
para.Add("email", "yourmail@gmail.com")
para.Add("type", "note")
para.Add("title", "This Is Title")
para.Add("body", "Content Put Here")
wc.Encoding = Encoding.UTF8
wc.Headers.Add("Authorization", "Bearer <your_access_token_here>")
Dim bResult() As Byte = wc.UploadValues("https://api.pushbullet.com/v2/pushes", para)
context.Response.Write(Encoding.UTF8.GetString(bResult))
Catch ex As Exception
HttpContext.Current.Response.Write(ex.InnerException)
End Try
End Using
view raw send.vb hosted with ❤ by GitHub

AutoHotKey MsgBox with parameter

使用參數方式,傳入title及內容,可當node.js或batch程式的訊息顯示
MsgBox ,262144,%1%,%2%
view raw MsgBox.ahk hosted with ❤ by GitHub
/*Loop, %0% ; For each parameter:
{
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
MsgBox, 4,, Parameter number %A_Index% is %param%. Continue?
IfMsgBox, No
break
}
*/
IF 0 = 2
{
MsgBox ,262144,%1%,%2%,10
}
ELSE IF 0 = 3
{
MsgBox ,262148,%1%,%2%,10
IfMsgBox, Yes
{
RUN %3%
}
}
view raw MsgBox2.ahk hosted with ❤ by GitHub
呼叫方式:
C:\Program Files\AutoHotKey\AutoHotkey.exe D:\MsgBox.ahk "This Is Title" "This Is Message"
C:\Program Files\AutoHotKey\AutoHotkey.exe D:\MsgBox2.ahk "Storm" "發現新主題,是否開啟?" "http://www.google.com.tw"


MsgBox

自駕游論壇 追文工具

  • 請選擇【只看樓主】 模式
  • 版面精減優化
  • 僅保留有照片的回覆帖

Chrome 相關設定

XP
%USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data
Vista/Win7
%LOCALAPPDATA%\Google\Chrome\User Data
設定user data
--user-data-dir="D:\Chrome"
設定cache
--disk-cache-dir="R:\Temp"
view raw setting.txt hosted with ❤ by GitHub

Win7 移動檔案、重新命名 找不到此項目

Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{2112AB0A-C86A-4ffe-A368-0DE96E47012E}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{2112AB0A-C86A-4ffe-A368-0DE96E47012E}\PropertyBag]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{491E922F-5643-4af4-A7EB-4E7A138D8174}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{491E922F-5643-4af4-A7EB-4E7A138D8174}\PropertyBag]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7b0db17d-9cd2-4a93-9733-46cc89022e7c}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7b0db17d-9cd2-4a93-9733-46cc89022e7c}\PropertyBag]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A302545D-DEFF-464b-ABE8-61C8648D939B}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A302545D-DEFF-464b-ABE8-61C8648D939B}\PropertyBag]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A990AE9F-A03B-4e80-94BC-9912D7504104}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A990AE9F-A03B-4e80-94BC-9912D7504104}\PropertyBag]
view raw fix.reg hosted with ❤ by GitHub

Batch With Log

[10:38:59.22]
E:\FolderA\youtube-dl.exe
E:\FolderA\新北市.gif
E:\FolderA\新北市行政區劃.png
複製 3 個檔案
[10:39:31.69]
E:\FolderA\GetTyphoon.js
E:\FolderA\Trace_My_TV_Series.js
複製 2 個檔案
@ECHO OFF
FOR /F "tokens=1-3 delims=/ " %%a IN ('DATE /t') DO (SET DATE=%%a-%%b-%%c)
SET NowTime=%time: =0%
SET LogPath=C:\%DATE%.log
ECHO [%NowTime%] >> %LogPath%
XCOPY /D /Y /I /H "E:\FolderA" "E:\FolderB" >> %LogPath%
view raw log.bat hosted with ❤ by GitHub

GT,GE,LT,LE,EQ,NE

GT: Greater Than , >
GE: Greater than or Equivalent with , >=
LT: Less than, <
LE: Less than or Equivalent with, <=
EQ: EQuivalent with, ==
NE: Not Equivalent with, /=

Query Xml String

DECLARE @tblXML TABLE (
UID int IDENTITY(1,1),
Software XML
)
INSERT INTO @tblXML (Software) VALUES ('<root><program><name>AAA</name></program><program><name>BBB</name></program></root>')
INSERT INTO @tblXML (Software) VALUES ('<root><program><name>CCC</name></program><program><name>DDD</name></program></root>')
INSERT INTO @tblXML (Software) VALUES ('<root><program><name>AAA</name></program><program><name>DDD</name></program></root>')
DECLARE @Software XML
DECLARE @tblAll TABLE (
Name nvarchar(max)
)
--設定指標
DECLARE tmpCursor CURSOR FAST_FORWARD FOR
SELECT TOP 100 [Software].query('//program//name') FROM @tblXML
OPEN tmpCursor --開啟指標
FETCH NEXT FROM tmpCursor INTO @Software --設定讀取變數
--迴圈讀取
WHILE @@FETCH_STATUS = 0
BEGIN
--PRINT CAST(@Software as nvarchar(max))
INSERT INTO @tblAll
SELECT n.value('.','nvarchar(max)')
FROM @Software.nodes('//name') t(n)
FETCH NEXT FROM tmpCursor INTO @Software
END
CLOSE tmpCursor --關閉指標
DEALLOCATE tmpCursor --移除指標
SELECT NAME, COUNT(NAME) 'Total' FROM @tblAll
GROUP BY NAME
view raw xmlstring.sql hosted with ❤ by GitHub

Detect User Agent


javascript - jQuery: check if user is using IE - Stack Overflow

Overlay (fx、ch、ie6~9)

jQuery.browser在1.9後就被拿掉了,為了通用性,用了另一種方式判斷ie6
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<!--[if lte IE 6]>
<script type="text/javascript">
var isIE6 = true;
</script>
<![endif]-->
<script type="text/javascript">
$(function() {
var $links = $('a');
$links.click(function(event) {
event.preventDefault(); //測試用,先把事件擋下來,避免網頁轉走
// fix IE6
if (typeof isIE6 !== 'undefined') {
$('body,html').css({'height':'100%','margin':0});
}
// 全畫面訊息
$('body').eq(0).append('<div id="myMask" style="text-align:center;background-color:#CCC;width:100%;height:100%;position: absolute;top:0;left:0;margin:0;"><span style="position:absolute;top:200px">Load Mask</span></div>');
// 透明度
$('#myMask').css({'opacity': 0.8});
});
});
</script>
view raw mask.js hosted with ❤ by GitHub

Read / Write ini

[Config]
Data=C:\data.xml
LastScan=2014/04/11 11:29:49
view raw config.ini hosted with ❤ by GitHub
MyIni.ReadIni("C:\config.ini", "Config", "Data", "")
MyIni.WriteIni("C:\config.ini", "Config", "LastScan", Now.ToString("yyyy/MM/dd HH:mm:ss"))
view raw HowToUse.vb hosted with ❤ by GitHub
Public Class MyIni
Private Declare Unicode Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringW" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Int32
Private Declare Unicode Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringW" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Int32, ByVal lpFileName As String) As Int32
Public Shared Sub WriteIni(ByVal iniFileName As String, ByVal Section As String, ByVal ParamName As String, ByVal ParamVal As String)
Dim Result As Integer = WritePrivateProfileString(Section, ParamName, ParamVal, iniFileName)
End Sub
Public Shared Function ReadIni(ByVal IniFileName As String, ByVal Section As String, ByVal ParamName As String, ByVal ParamDefault As String) As String
Dim ParamVal As String = Space$(1024)
Dim LenParamVal As Long = GetPrivateProfileString(Section, ParamName, ParamDefault, ParamVal, Len(ParamVal), IniFileName)
ReadIni = Left$(ParamVal, LenParamVal)
End Function
End Class
view raw MyIni.vb hosted with ❤ by GitHub

Hide batch window

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("D:\MySoftware\EmptyApps.bat"), 0, True
view raw hide.vbs hosted with ❤ by GitHub

HTML5 classList API

myDiv.classList.add('myCssClass');
myDiv.classList.remove('myCssClass');
myDiv.classList.toggle('myCssClass'); //now it's added
myDiv.classList.toggle('myCssClass'); //now it's removed
myDiv.classList.contains('myCssClass'); //returns true or false
view raw classList.js hosted with ❤ by GitHub

Generate Fake Files (產生自訂大小假檔案)

fsutil file createnew 1MB.txt 1048576
fsutil file createnew 5MB.txt 5242880
fsutil file createnew 10MB.txt 10485760
fsutil file createnew 20MB.txt 20971520
fsutil file createnew 40MB.txt 41943040
view raw FakeFile.bat hosted with ❤ by GitHub

使用fsutil file createnew快速產生虛胖檔案 - Level Up- 點部落 散人的備忘錄: 在 Windows 產生大檔案

Check Date (判斷日期有效性)

function IsDate(strDate) {
var eachNum = /(\d{4})\/(\d{2})\/(\d{2})/.exec(strDate);
var year = parseInt(eachNum[1], 10);
var month = parseInt(eachNum[2], 10) - 1;
var day = parseInt(eachNum[3], 10);
var d = new Date(year, month, day);
return !(d.getFullYear() !== year || d.getMonth() !== month || d.getDate() !== day)
}
console.log(IsDate('2011/02/30')); //false
console.log(IsDate('2012/02/29')); //true
console.log(IsDate('2013/02/29')); //false
view raw IsDate.js hosted with ❤ by GitHub

Check date in JavaScript - Stack Overflow

Eventquery.vbs (指令查詢Event Log)

查詢MSSQLSERVER最新一筆錯誤記錄 C:\WINDOWS\system32>cscript eventquery.vbs /L Application /FO table /FI "Type eq Error" /FI "Source eq MSSQLSERVER" /r 1
REM Get today's date
set today=
set month=%date:~5,2%
set day=%date:~8,2%
set year=%date:~0,4%
REM Start query at midnight
set today=%month%/%day%/%year%,12:00:00AM
echo %today%
C:
CD C:\WINDOWS\system32\
cscript eventquery.vbs /L Application /FO table /FI "Type eq Error" /FI "Datetime gt %today%" /r 10
cscript eventquery.vbs /L SYSTEM /FO table /FI "Type eq Error" /FI "Datetime gt %today%" /r 10
view raw query.bat hosted with ❤ by GitHub

Eventquery.vbs Yay! A fix for EventQuery - Windows Security Logging and Other Esoterica - Site Home - MSDN Blogs

Format Date String

function padLeft(nr, n, str) {
return Array(n - String(nr).length + 1).join(str || '0') + nr;
}
if (!Date.prototype.toMyString) {
Date.prototype.toMyString = function() {
var y = this.getFullYear();
var m = this.getMonth() + 1;
var d = this.getDate();
return y + '/' + padLeft(m,2) + '/' + padLeft(d,2);
}
}
console.log(new Date('2012/02/05').toMyString()); // 2012/02/05
view raw formatDate.js hosted with ❤ by GitHub
Date.prototype.addHours = function(h) {
this.setHours(this.getHours() + h);
return this;
};
Date.prototype.toMyDate = function() {
return this.getFullYear() + padLeft(this.getMonth()+1, 2) + padLeft(this.getDate(), 2);
};
Date.prototype.toMyTime = function() {
return padLeft(this.getHours(), 2) + ':' + padLeft(this.getMinutes(), 2) + ':' + padLeft(this.getSeconds(), 2);
};
function padLeft(nr, n, str) {
return Array(n - String(nr).length + 1).join(str || '0') + nr;
}
var now = new Date(),
yesterday = new Date().addHours(-24);
console.log('now time: %s',now.toMyTime());
console.log('now date: %s',now.toMyDate());
console.log('yesterday time: %s',yesterday.toMyTime());
console.log('yesterday date: %s',yesterday.toMyDate());
view raw OtherFunc.js hosted with ❤ by GitHub

編碼轉換

static string CovertEncoding(int intSrcEncode, int intDstEncode, string strSrc)
{
byte[] bSrc = Encoding.GetEncoding(intSrcEncode).GetBytes(strSrc);
byte[] bDst = Encoding.Convert(Encoding.GetEncoding(intSrcEncode), Encoding.GetEncoding(intDstEncode), bSrc);
string strResult = Encoding.GetEncoding(intDstEncode).GetString(bDst);
return strResult;
}
''' <summary>
''' 字串編碼轉換
''' </summary>
''' <param name="intSrcEncode">來源編碼</param>
''' <param name="intDstEncode">目的編碼</param>
''' <param name="strSrc">待轉換字串</param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function CovertEncoding(ByVal intSrcEncode As Integer, ByVal intDstEncode As Integer, ByVal strSrc As String) As String
Dim bSrc As Byte() = Encoding.GetEncoding(intSrcEncode).GetBytes(strSrc)
Dim bDst As Byte() = Encoding.Convert(Encoding.GetEncoding(intSrcEncode), Encoding.GetEncoding(intDstEncode), bSrc)
Dim strResult As String = Encoding.GetEncoding(intDstEncode).GetString(bDst)
Return strResult
End Function

[C#].Net編碼轉換 Unicode to Big5 | 好風工作室

Firebug tabs font size too small (Firebug頁籤字型過小)

userChrome.css .innerToolbar, .panelTab-text {font-size-adjust: 0 !important;}
BobChao the Blogger: Firebug 頁籤文字太小的繞路解法

Get Window ID Under Mouse

MouseGetPos, ClickX, ClickY, WindowUnderMouseID
WinActivate, ahk_id %WindowUnderMouseID%
WinGet, winStatus, MinMax, ahk_id %WindowUnderMouseID%
If winStatus = 1
{
WinRestore, ahk_id %WindowUnderMouseID%
}
Else If winStatus = 0
{
WinMaximize, ahk_id %WindowUnderMouseID%
}
Return
view raw Under Mouse.ahk hosted with ❤ by GitHub

Win7 檔案總管 瀏覽窗格(Navigation Pane)

Windows Registry Editor Version 5.00

;x32 -> Wow6432Node
;我的最愛(關a9400100,開a0900100)
[HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]
"Attributes"=dword:a9400100
;媒體櫃(關b090010d,開a0900100)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder]
"Attributes"=dword:b090010d
;家用群組(關b094010c,開b084010c)
[HKEY_CLASSES_ROOT\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder\]
"Attributes"=dword:b084010c

;x64
;我的最愛(關a9400100,開a0900100)
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]
"Attributes"=dword:a9400100
;媒體櫃(關b090010d,開a0900100)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder]
"Attributes"=dword:b090010d
;家用群組(關b094010c,開b084010c)
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder\]
"Attributes"=dword:b084010c

Homegroup - Add or Remove from Navigation Pane - Windows 7 Help Forums TWed2k - 心得教學區 - [整理] 移除 Win7 檔案總管下惱人的我的最愛、媒體櫃 Remove Favorites, Libraries and Network from Windows 7 / 2008R2 Common File Dialog (Windows Explorer) | Weblog.BassQ.nl

Win7 檔案總管自訂工具按鈕

[小密技]免軟體!直接在windows 7的工具列上加入複製/貼上/刪除…等好用按鈕! | ㊣軟體玩家 Windows Explorer Toolbar Buttons - Customize - Windows 7 Help Forums WinAero: Explorer Toolbar Editor CustomExplorerToolbar - Add Copy/Cut/Paste buttons to the Explorer toolbar of Windows 7

Win7 關閉媒體櫃

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{031E4825-7B94-4dc3-B131-E946B44C8DD5}]
[-HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{2112AB0A-C86A-4ffe-A368-0DE96E47012E}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{491E922F-5643-4af4-A7EB-4E7A138D8174}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7b0db17d-9cd2-4a93-9733-46cc89022e7c}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A302545D-DEFF-464b-ABE8-61C8648D939B}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A990AE9F-A03B-4e80-94BC-9912D7504104}]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel] "{031E4825-7B94-4dc3-B131-E946B44C8DD5}"=-

How To Disable and Remove Libraries from Windows 7 Explorer « My Digital Life I'll rocK the World!!: [Windows] 重組Windows 7瀏覽窗格

Feedly (NK ver)

Query Jobs (Running, Fail, Duration)

DECLARE @Yesterday AS datetime
SET @Yesterday = DATEADD(DAY,DATEDIFF(DAY,1,GETDATE()),0)
-- Running Jobs
SELECT job.Name,
job.job_ID,
job.Originating_Server,
activity.run_requested_Date,
DATEDIFF(MINUTE, activity.run_requested_Date, GETDATE()) AS Elapsed
FROM msdb.dbo.sysjobs_view job
INNER JOIN msdb.dbo.sysjobactivity activity
ON (job.job_id = activity.job_id)
WHERE run_Requested_date IS NOT NULL AND stop_execution_date IS NULL
AND job.name IN ('01.DEL','02.Import','03.Daily Job')
-- Fail Jobs
SELECT
j.name AS 'JobName',
s.step_id AS 'Step',
s.step_name AS 'StepName',
msdb.dbo.agent_datetime(run_date, run_time) AS 'RunDateTime'
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobsteps s
ON j.job_id = s.job_id
INNER JOIN msdb.dbo.sysjobhistory h
ON s.job_id = h.job_id
AND s.step_id = h.step_id
AND h.step_id <> 0
WHERE j.enabled = 1
AND j.name IN ('01.Del','02.Import','03.Process')
AND msdb.dbo.agent_datetime(run_date, run_time) >= @Yesterday
AND h.run_status <> 1
ORDER BY JobName, RunDateTime DESC
-- Show Single Job Total Time
SELECT
j.name as 'JobName',
msdb.dbo.agent_datetime(h.run_date, h.run_time) as 'RunDateTime',
(SUBSTRING(RIGHT('0000000'+CAST(run_duration as varchar),6),1,2)) as 'RunDurationHours',
(SUBSTRING(RIGHT('0000000'+CAST(run_duration as varchar),6),3,2)) as 'RunDurationMinutes',
(SUBSTRING(RIGHT('0000000'+CAST(run_duration as varchar),6),5,2)) as 'RunDurationSeconds'
FROM msdb.dbo.sysjobhistory h
LEFT JOIN msdb.dbo.sysjobs j
ON j.job_id = h.job_id and step_id =0
WHERE j.enabled = 1
AND j.name = '01.Del'
AND msdb.dbo.agent_datetime(run_date, run_time) >= @Yesterday
-- Show Single Job Each Setp Time
SELECT
j.name as 'JobName',
s.step_id as 'Step',
s.step_name as 'StepName',
msdb.dbo.agent_datetime(run_date, run_time) as 'RunDateTime',
(SUBSTRING(RIGHT('0000000'+CAST(run_duration as varchar),6),1,2)) as 'RunDurationHours',
(SUBSTRING(RIGHT('0000000'+CAST(run_duration as varchar),6),3,2)) as 'RunDurationMinutes',
(SUBSTRING(RIGHT('0000000'+CAST(run_duration as varchar),6),5,2)) as 'RunDurationSeconds'
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobsteps s
ON j.job_id = s.job_id
INNER JOIN msdb.dbo.sysjobhistory h
ON s.job_id = h.job_id
AND s.step_id = h.step_id
AND h.step_id <> 0
WHERE j.enabled = 1
AND j.name = '03.Process'
AND msdb.dbo.agent_datetime(run_date, run_time) >= CONVERT(CHAR(10), GETDATE(), 20)
AND s.step_id IN (2,4,5)
ORDER BY Step
view raw QueryJobs.sql hosted with ❤ by GitHub

Toggle Hidden Files & File Extension

; Toggle File Extensions
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt
If (HiddenFiles_Status = 1)
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 0
Else
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 1
If (eh_Class = "#32770" OR A_OSVersion = "WIN_VISTA")
Send, {F5}
Else
PostMessage, 0x111, 28931,,, A
Return
; Toggle Hidden Files (include system files)
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
If (HiddenFiles_Status = 1)
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 2
}
Else
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 1
}
WinGetClass, eh_Class,A
If (eh_Class = "#32770" OR A_OSVersion = "WIN_VISTA")
Send, {F5}
Else
PostMessage, 0x111, 28931,,, A
Return

移除右鍵INTEL選單

REGEDIT4

[-HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\igfxcui]

圖形 — 移除以滑鼠右鍵按一下桌面功能表

主機板音源孔

  • 藍色(音源輸入):外接光碟機、隨身聽等可透過此孔位輸入PC。
  • 綠色(音源輸出):在使用標準2聲道模式或耳機時透過此孔位輸出,於5.1聲模式叭時擔任前置主聲道輸出。
  • 粉紅色(麥克風):連接麥克風裝置。
  • 橘色(重低音輸出):於5.1聲道模式時提供重低音輸出。
  • 黑色(後喇叭輸出):於5.1聲道模式時提供後置環繞聲道輸出。
  • 灰色(側喇叭輸出):於5.1聲道模式時提供側置環繞聲道輸出。

聯強 e 城市

Mklink

mklink /d D:\Dropbox\Album E:\MyPictures P.S. 不用先建立D:\Dropbox\Album資料夾
硬連結?軟連結?檔案分身不乏術 | T客邦 - 我只推薦好東西 mklink 在 Winodws 7 建立 symbolic link - 瓶水相逢 - 艾小克- 點部落 [新手教室]如何把不同磁碟機內的多個資料夾,送上多種雲端服務直接做同步? | ㊣軟體玩家 好用的mklink指令幫我作到超級C碟 @ Haoming-跟著滑鼠去旅行 (挨踢日記) :: 隨意窩 Xuite日誌 Windows 的 mklink 符號連結(symbolic link), 永久連結(hard link), 與目錄連接(Directory Junction) @ FBI :: 隨意窩 Xuite日誌

Win7 using SSD

  • AHCI

安裝OS前記得先到BIOS內開啟AHCI,如果 OS 已安裝成 IDE 模式,尋找HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci,修改將start修改為 0 ,然後重開機進入BIOS啟用 AHCI,之後再進到Windows時會重新安裝SATA驅動。

  • 4K對齊

SSD 新手使用須知:4K 對齊調教實戰,提昇 SSD 效能 | T客邦 - 我只推薦好東西

  • TRIM

執行fsutil behavior query DisableDeleteNotify,顯示 DisableDeleteNotify = 0 表示TRIM功能已啟用。

  • 關閉服務
    • Superfetch

    亦同時停止了 Prefetch 及 ReadyBoost 功能,停用後,刪除 c:\windows\prefetch 目錄內的檔案文件。

    • Windows Search
    • Windows Font Cache
  • 停止磁碟重組自動排程

執行dfrgui,選[設定排程] → 取消勾選[依排程執行(建議)] → [確定]

  • 登錄檔
    • Prefetch & SuperFetch

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management\PrefetchParameters,修改EnablePrefetcherEnableSuperfetch的值改為 0

    • LastAliveStamp

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability,修改TimeStampInterval預設值 1 改為 0

    • PagingExecutive

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management,修改DisablePagingExecutive預設值 0 改為 1

    • ClearPageFileAtShutdown & LargeSystemCache

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management,修改ClearPageFileAtShutdown值改為 0,修改LargeSystemCache值改為 0

    • BootOptimizeFunction

    KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction,修改Enable值改為N

  • Windows Customer Experience Improvement Program(停用客戶經驗改進計畫)
    1. 執行 gpedit.msc,系統管理範本 -> 系統 -> 網際網絡通訊管理 -> 網際網絡通訊設定,在「關閉 Windows 客戶經驗改進計劃」內勾選「啟用」。
    2. 執行 taskschd.msc,工作排程器程式庫 -> Microsoft -> Windows -> Customer Experience Improvement Program滑鼠右點將三個排程Consolidator、KernelCeipTask、UsbCeip停用。
    3. 停止 RAC 自動排程每小時一次 CEIP 的關聯,執行 taskschd.msc 工作排程器,展開「工作排程器程式庫 -> Microsoft -> Windows -> RAC 」,滑鼠右點將排程 RacTask 停用。
  • ReadyBoot Tracing Log

執行perfmon,資料蒐集器集合工具 -> 啟動事件追蹤工具階段 -> 點按 ReadyBoot,在 ReadyBoot 的「追蹤工具階段」頁內點按不勾選「已啟用 (Enabled) 」,完成後刪除C:\Windows\Prefetch\ReadyBoot\ReadyBoot.etl。

  • Window暫存資料夾

環境變數→ tmp、tmep設定在Ramdisk

  • 停用休眠功能

執行powercfg -h off,刪除hiberfil.sys

  • 關閉 IPv6
    1. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters,新增DWORD值選DisabledComponents,將數值設定為 ffffffff。
    2. 停用服務IP-Helper。
    3. 區域連線,取消選取[際網路通訊協定第 6 版 (TCP/IPv6)]
  • 關閉硬碟前的時間

電源選項 → 套用[高效能] → [變更進階電源] → [硬碟] → 時間變更為 0分鐘(永不)

  • 停用8.3格式檔案名稱

執行fsutil behavior set disable8dot3 1

  • 保持SSD可用空間最少15%以上。
  • 關閉系統還原。
view raw gistfile1.md hosted with ❤ by GitHub

minfree

# 寫入
echo "2560,4096,5632,10240,11776,14848" > /sys/module/lowmemorykiller/parameters/minfree
# 讀取
cat /sys/module/lowmemorykiller/parameters/minfree # 這些數字的單位是page. 1 page = 4 kb.上面的六個數字對應的就是(MB): 10,16,22,40,46,58
  • 2560 => FOREGROUND_APP => 前景程式,目前正在執行
  • 4096 => VISIBLE_APP => 可見程式,目前未執行但尚未結束
  • 5632 => SECONDARY_SERVER => 作業系統需要的服務
  • 10240 => HIDDEN_APP => 隱藏程式,目前所不需要的服務
  • 11776 => CONTENT_PROVIDER => App 的內容提供者 (APP有執行時優先權會調高)
  • 14848 => EMPTY_APP => 空程式 , 並沒有執行,僅保留再記憶體 (優先要釋放的)

淡如弱雲: Android 記憶體調教 android 內存管理機制_最愛我家蕾蕾^.^_百度空間