%USERPROFILE%\AppData\Local\Temp
系統變數 TEMP、TMP
%SystemRoot%\TEMP
%USERPROFILE%\AppData\Local\Temp
%SystemRoot%\TEMP
"C:\Program Files\IIS Express\appcmd.exe"
"C:\Program Files\IIS Express\iisexpress.exe" /site:DemoSite
appcmd.exe list site
appcmd.exe delete site "WebSite"
- 開啟 %homepath%\Documents\IISExpress\config\applicationhost.config
- 修改<binding protocol="http" bindingInformation="*:8080:192.168.1.10" />
@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 |
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 |
@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 |
$.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); | |
} | |
}); |
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); | |
} | |
}); |
$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 |
MsgBox ,262144,%1%,%2% |
/*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% | |
} | |
} |
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"
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" |
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] |
[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% |
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 |
<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> |
[Config] | |
Data=C:\data.xml | |
LastScan=2014/04/11 11:29:49 |
MyIni.ReadIni("C:\config.ini", "Config", "Data", "") | |
MyIni.WriteIni("C:\config.ini", "Config", "LastScan", Now.ToString("yyyy/MM/dd HH:mm:ss")) |
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 |
Set objShell = WScript.CreateObject("WScript.Shell") | |
objShell.Run("D:\MySoftware\EmptyApps.bat"), 0, True |
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 |
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 |
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 |
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 |
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 |
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()); |
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 |
.innerToolbar, .panelTab-text {font-size-adjust: 0 !important;}
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 |
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
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}"=-
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 |
; 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 |
REGEDIT4
[-HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\igfxcui]
mklink /d D:\Dropbox\Album E:\MyPictures
P.S. 不用先建立D:\Dropbox\Album資料夾
安裝OS前記得先到BIOS內開啟AHCI,如果 OS 已安裝成 IDE 模式,尋找HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci,修改將start修改為 0 ,然後重開機進入BIOS啟用 AHCI,之後再進到Windows時會重新安裝SATA驅動。
執行fsutil behavior query DisableDeleteNotify,顯示 DisableDeleteNotify = 0 表示TRIM功能已啟用。
亦同時停止了 Prefetch 及 ReadyBoost 功能,停用後,刪除 c:\windows\prefetch 目錄內的檔案文件。
執行dfrgui,選[設定排程] → 取消勾選[依排程執行(建議)] → [確定]
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management\PrefetchParameters,修改EnablePrefetcher及EnableSuperfetch的值改為 0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability,修改TimeStampInterval預設值 1 改為 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management,修改DisablePagingExecutive預設值 0 改為 1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management,修改ClearPageFileAtShutdown值改為 0,修改LargeSystemCache值改為 0
KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction,修改Enable值改為N
執行perfmon,資料蒐集器集合工具 -> 啟動事件追蹤工具階段 -> 點按 ReadyBoot,在 ReadyBoot 的「追蹤工具階段」頁內點按不勾選「已啟用 (Enabled) 」,完成後刪除C:\Windows\Prefetch\ReadyBoot\ReadyBoot.etl。
環境變數→ tmp、tmep設定在Ramdisk
執行powercfg -h off,刪除hiberfil.sys
電源選項 → 套用[高效能] → [變更進階電源] → [硬碟] → 時間變更為 0分鐘(永不)
執行fsutil behavior set disable8dot3 1
# 寫入
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