顯示具有 Windows Client 標籤的文章。 顯示所有文章
顯示具有 Windows Client 標籤的文章。 顯示所有文章

2026-05-11

Powershell 取得運作中的程序,Kill 掉

取得 Process,Kill 掉:

Powershell 指令:

Get-Process | Select-Object `
Name,
Id,
@{N="ExeName";E={
if ($_.Path) { Split-Path $_.Path -Leaf } else { "N/A" }
}},
@{N="FullPath";E={$_.Path}},
@{N="CPU(s)";E={$_.CPU}},
@{N="Memory(MB)";E={[Math]::Round($_.WorkingSet64/1MB,2)}},
@{N="Owner";E={
try {
(Get-CimInstance Win32_Process -Filter "ProcessId=$($_.Id)") |
Invoke-CimMethod -MethodName GetOwner |
ForEach-Object { "$($_.Domain)\$($_.User)" }
} catch {
"N/A"
}
}}

2026-05-07

Reset Microsoft Edge (開起來後幾秒鐘就會無回應然後自動關閉)

taskkill /IM msedge.exe /F

Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge\User Data" -Recurse -Force

Get-AppxPackage -Name Microsoft.MicrosoftEdge.Stable -AllUsers `
| Foreach {
    Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"

}

2026-05-06

Clipboard 剪貼簿突然不能用 (With RDP Connection)

簡單說就是遠端桌面連線目標的 rdpclip.exe 出現問題
解決方式:
將遠端電腦的 rdpclip.exe process kill 掉重開就好了

taskkill /f /im rdpclip.exe

rdpclip.exe

結案

2026-03-05

在 Windows 下讓 del 有個 alias name: rm

在 Windows 下讓 del 指令有個 alias name: rm

方法:

  • 建立 C:\Windows\System32\rm.cmd
  • 內容:
    @echo off
    del %*
結果: c:\> rm a.txt
等於: c:\> del a.txt

2026-02-03

Open "Find Printers" by Hyperlink



Microsoft Edge

# AutoOpenFileTypes: qds
GPO: Computer Configuration → Administrative Templates → Microsoft Edge → List of file types that should be automatically opened on download
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes" -Force | Out-Null
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes" -Name "1" -Value "qds" -PropertyType String -Force | Out-Null

# AutoOpenAllowedForURLs: 只允許 intranet.contoso.com
GPO: Computer Configuration → Administrative Templates → Microsoft Edge → URLs where AutoOpenFileTypes can apply
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs" -Force | Out-Null
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs" -Name "1" -Value "intranet.contoso.com" -PropertyType String -Force | Out-Null
          Verify: edge://policy


Google Chrome

2025-04-18

Windows TCP Port Forwarding (Proxy)

古時候 (2000年左右) Windows 98 時代對於網路不太熟悉
有接觸到一個小程式叫做 PortMagic V130 (網路魔術師)
可以做到 Port Forwarding 的功能,也就是將電腦作為跳板的用途

現在只要下指令就可以做到了:
netsh interface portproxy add v4tov4 listenport=80 listenaddress=192.168.1.10 connectport=80 connectaddress=1.1.1.1
紅色的部分 是本機電腦要聽的 Port 與  IP
綠色的部分 是要轉去目標的 Port 與  IP

用這個指令可以查目前的設定:
netsh interface portproxy show all
這樣刪除
netsh interface portproxy delete v4tov4 listenport=80 listenaddress=192.168.1.10

netsh interface portproxy delete listenport=80 listenaddress=192.168.1.10
參考資料:

2024-07-08

Windows CPU/RAM/Disk Performance Monitor Log - typeperf

$Path = 'C:\';
$Folder = 'PerfLogs';
$FullPath = ($Path + $Folder + '\');
$CounterFile = 'Counters.txt';
$LoopSeconds = 5;
$LogKeepDays = 30;

$Now = (Get-Date);

if ((Test-Path $FullPath) -eq $False) {
write-host ('Path ' + $FullPath + ' not found.');
New-Item -Path $Path -Name $Folder;
exit;
};

2022-08-15

Enable TLS 1.2 for Azure Virtual Desktop Client on Windows 7

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force

If (-Not (Test-Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319')) {
    New-Item 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -Force | Out-Null;
};
New-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -Name 'SystemDefaultTlsVersions' -Value '1' -PropertyType 'DWord' -Force | Out-Null;
New-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -PropertyType 'DWord' -Force | Out-Null;

If (-Not (Test-Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319')) {
    New-Item 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Force | Out-Null;
};
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Name 'SystemDefaultTlsVersions' -Value '1' -PropertyType 'DWord' -Force | Out-Null;
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -PropertyType 'DWord' -Force | Out-Null;

2022-06-14

用 GPO 允許 User 安裝印表機驅動程式的設定

GPO

Computer Configuration
- Policies
- Windows Settings
- Security Settings
- Local Policies
- User Rights Assignment
- Load and unload device drivers 

Domain Users

Computer Configuration
- Policies
- Windows Settings
- Security Settings
- Local Policies
- Security Options
- Devices: Prevent users from installing printer drivers 

Disable

 Computer Configuration
- Policies
- Administrative Templates
- System/Device Installation/Device Installation Restrictions
- Allow installation of devices using drivers that match these device setup classes 

Computer Configuration
- Policies
- Administrative Templates
- System/Driver Installation
- Allow non-administrators to install drivers for these device setup classes

上面這兩個設定中原本只有以下這兩個:
{4658ee7e-f050-11d1-b6bd-00c04fa372a7}
{4d36e979-e325-11ce-bfc1-08002be10318}

Windows 10 & Windows 11 會一直出現 Driver is unavailable
查到還要再加下面這個就正常了:

2021-02-09

處理 Windows 10 / 2019 預設視窗邊界很難分辨的問題

不知道別人的情況如何
但我根本分辨不出來上層這個視窗的邊界在哪裡
所以無法辨別滑鼠游標要在哪裡按才能拖曳視窗

問題是,修改視窗標題、邊框顏色等功能又要先啟動作業系統後才能修改
微軟這真是莫名其妙、喪心病狂的設定...
只好出動註冊機碼來處理這件事

2021-01-15

Backup and Restore NTFS Permission (ACL) and Owner with PowerShell

Backup

$TargetPath = 'C:\PathToBackup';
$ACLFile = 'C:\NTFSBackup.csv';
$PathReplaceKeyword = 'AKeywordToReplacePathForRetoreToDifferentPath'

$ACLArray = @();
$ACLArray += (Get-item -path $TargetPath | Get-ACL | Select-Object @{Name="Path"; Expression={($_.Path -Replace [regex]::Escape($TargetPath),$PathReplaceKeyword)}},Owner,Sddl);
$ACLArray += (Get-Childitem -path $TargetPath -recurse | Get-ACL | Select-Object @{Name="Path"; Expression={($_.Path -Replace [regex]::Escape($TargetPath),$PathReplaceKeyword)}},Owner,Sddl);
$ACLArray | Export-CSV $ACLFile -NoTypeInformation;

 

2021-01-07

Robocopy 複製 NTFS ACL (Permission) 與差異化複製 (Differential Copy)

複製 NTFS ACL (Permission)

    RoboCopy <source> <target> /MIR /SEC /SECFIX

差異化複製 Differential Copy

    RoboCopy <source> <target> /e /xo /purge

差異化複製 Differential Copy + 複製 NTFS ACL (Permission)

    RoboCopy <source> <target> /SEC /SECFIX /xo /purge

2021-01-02

Azure Windows 10 Multi-Session Language Packs 多國語言包離線安裝

不知為何在 Azure 上建立的 Windows 10 Multi-Session Version 用線上安裝語言包進度都不會動
而且之前記錄的這篇 Windows 10 Language Packs 多國語言字型問題 的指令敲下去也不會動

找了一下,微軟有提供語言包 ISO 檔可以下載
網頁中也有安裝的語法

要下載兩個 ISO 檔,分別是 Language ISO 與 FOD Disk 1 ISO

Mount 後直接下指令
以下列出常用的: 繁體中文、簡體中文及日文的安裝 Powershell Command

2020-09-28

Office365 無法啟動結果是 Windows Event Log 起不來

今天遇到了一個不知怎麼發生問題
User 的 Office 365 無法完成產品啟動 (原本使用中都沒問題)
如果去執行產品啟動會出現如下錯誤,但網路明明就是通的

2020-05-22

清除 UNC Path 的 Credential Cache

有時候我們用 \\ComputerName 的方式去連 Share Folder 並敲入帳號密碼
雖然並沒有勾選記住我的認證,這組驗證還是會被 Cache 起來方便後續連線

但常常遇到必須更改連線認證的情況,又沒有辦法從圖形介面去刪除 Cache
此時只需要以下指令:

net use * /delete


2020-03-27

移除 Windows 7 中沒有正常移除乾淨的 Internet Explorer 11 (IE11)

事情發生在從【控制台】的【程式和功能】中【開啟或關閉 Windows 功能】將 IE 11 取消打勾後無法再重新安裝 IE 11 的情況,安裝初階段就會告訴你已經有安裝更新的版本了,不能安裝,或是跟你說重開機才能使用新的瀏覽器但是重開機後依然沒有 IE。

此時可以到【控制台】的【程式和功能】中的【解除安裝程式】找尋已經安裝的更新並將他移除,或是可以下指令:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /norestart"
新版 IE 在此下載
https://support.microsoft.com/zh-tw/hub/4230784/internet-explorer-help
https://support.microsoft.com/zh-tw/help/17621

2018-09-06

取得連結網路磁碟機的資訊 (Get Mapped Network Drive Letter & UNC Path) with VBS

Set objNetwork = WScript.CreateObject("WScript.Network")
Set colDrives = objNetwork.EnumNetworkDrives
For i = 0 to colDrives.Count-1 Step 2
   Wscript.Echo colDrives.Item(i) & vbTab & colDrives.Item (i + 1)
Next

2018-05-14

Media Player Classic Home Cinema 變更播放速度時播放聲調不變之設定

Media Player Classic Home Cinema 變更播放速度時播放聲調不變之設定

View (檢視)-> Options (設定選項) ->

Left Pannel (左方項目頁籤):
Playback (撥放器)
Right Pannel (右方設定項目):
Control (控制) -> Speed step (速度步進)-> Change to (變更為) 10 %




Left Pannel (左方項目頁籤):
Playback (撥放器) -> Output (輸出)
Right Pannel (右方設定項目):
Audio Renderer (音訊譜製器)-> Change to (變更為) 10: Internal Audio Renderer




2022.10.13 Update
Version 1.9.23Audio Renderer => MPC Audio Renderer

2018-03-23

Windows 10 變更預設瀏覽器小程式 Change Default Browser

因為不知名的原因, Windows 10 的環境下點擊 Outlook 信件中的超連結時
出現了這個很冏的視窗


哪裡冏呢? 他沒有提供 IE 或 Chrome 或任何已經安裝好的瀏覽器給人選
一定要自己去 [設定] 裡面選才行
而這個問題不是單一事件, 有許多人都遇到了

2017-12-20

Windows 8 / 8.1 / 10 注音輸入法切換問題

Windows 8 以後切換到注音輸入法時, 預設都是 [注音] (ㄅ)
即使將注音輸入法預設鍵盤模式從 [中文模式] 改為 [英數模式]
切換時預設也還是跳為 [注音] (ㄅ)
這個問題相當惱人, 最近找到一個方法, 除了上述這個設定之外
還必須加入以下註冊機碼

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Keyboard Layout\Substitutes]
"00000404"="00000409"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\IME\15.0\IMETC]
"Default Input Mode"="0x00000001"

這個註冊機碼也可以下 Command:

reg add "HKEY_CURRENT_USER\Keyboard Layout\Substitutes" /v 00000404 /t REG_SZ /d 00000409 /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\IME\15.0\IMETC" /v "Default Input Mode" /t REG_SZ /d "0x00000001" /f

如此一來, 切換到注音輸入法的時候預設就會是 [英數] 而不是注音 (ㄅ)

但是, 預設是注音輸入法的 [英數]
必須用 Shift 切換才會變成注音輸入法的 [注音] (ㄅ)

如果習慣用 Ctrl + Space 切換的人, 用 Ctrl + Space 切換的話仍然是 [英數] 輸入
再 Ctrl + Space 切回來也還是 [英數]
必須用 Shift 切換變成注音輸入法的 [注音] (ㄅ)
之後再用 Ctrl + Space 切換才會是 [英數] / [注音] (ㄅ) 互相切換
而且每個應用程式視窗預設都是如此
對於已經很習慣只用 Ctrl + Space 切換的人來說相當不方便

除此之外還有一個例外
如果是被 UAC 介入的情況下 (無論是否將 UAC 關閉)
程式開啟後仍然是注音輸入法的 [注音] (ㄅ)

如果要強制只使用中文語言:

$LanguageList = Get-WinUserLanguageList
$MarkedLanguage = $LanguageList | where LanguageTag -eq 'en-US'
$LanguageList.Remove($MarkedLanguage)
Set-WinUserLanguageList $LanguageList -Force