Ventoy&VHDX

關閉電源選項(cmd.exe)

 powercfg -h off

關機 / 重開機指令


重開機

shutdown /r /f /t <秒數>


關機

shutdown /s /f /t <秒數>

移除浮水印

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache]

"SV1"=dword:00000000

"SV2"=dword:00000000


啟動到系統後, 打開”運行”, 輸入”regedit”(不包括雙引號)命令打開註冊表, 

定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\FsDepends\Parameters 項, 修改VirtualDiskExpandOnMount 的16進制數值為4, 重啟電腦後生效. 

Windows Registry Editor Version 5.00

[ HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \FsDepends \Parameters ]

"VirtualDiskExpandOnMount"=dword:00000004



帳號密碼過期提醒:帳號可以直接以指令新增並加入管理員群組,預設42天後會強制變更密碼,雖然一樣可以空密碼跳過,但總是有點煩人,可以用 powershell 指令直接設成密碼永不過期。

net user 帳號 /add

net localgroup administrators 帳號 /add

powershell Set-LocalUser -Name "帳號" -PasswordNeverExpires 1


VHDX差分:若需要有『分鐘級』還原功能,可安裝完成後產生2個差異磁碟,日常使用+還原用各一,diskpart 或 bootice 均可處理。

diskpart

Create vdisk file=”c:\test\test.vhdx” parent=”c:\test\parent.vhdx”


如果不是自己用,存放 vhdx 的資料夾、ventoy 資料夾、VTOYEFI 分割區最好設為隱藏

attrib +s +h file_or_folder_path

分割區 id 設為 16 ,可用 bootice 處理或以 diskpart 指令處理

https://www.diskpart.com/articles/change-partition-type-id-8523.html


reg import xxx.reg

del /f xxx.reg

del /f *.reg


Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SYSTEM\Setup]

"OOBEInProgress"=dword:00000000

"SetupPhase"=dword:00000000

"SetupSupported"=dword:00000000

"SetupType"=dword:00000000

"SystemSetupInProgress"=dword:00000000


[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\FsDepends\Parameters]

"VirtualDiskExpandOnMount"=dword:00000004

"VirtualDiskMaxTreeDepth"=dword:00000002

"VirtualDiskNoLocalMount"=dword:00000000


[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\FsDepends\Parameters\AccessControl]

"ISOMountAllowNormalUser"=dword:00000001


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]

"EnableLUA"=dword:00000000


[HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache]

"SV2"=dword:00000000

"SV1"=dword:00000000

HKEY_CURRENT_USER\\Control Panel\\UnsupportedHardwareNotificationCache

https://winaero.com/how-to-remove-system-requirements-not-met-watermark-in-windows-11/


Windows Registry Editor Version 5.00 ; Created by Sergey Tkachenko for Winaero.com ; Tutorial: https://winaero.com/how-to-remove-system-requirements-not-met-watermark-in-windows-11/ [HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache] "SV2"=dword:00000000 "SV1"=dword:00000000


HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System



Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] "EnableLUA"=dword:00000000


允許一般帳號掛接 ISO 檔

HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\FsDepends\\Parameters\\AccessControl


確認或修改以下項目的數值資料


阻止 VHDX 自動擴展至完整大小

HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\FsDepends\\Parameters


確認或修改以下項目的數值資料

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\FsDepends\Parameters] "VirtualDiskExpandOnMount"=dword:00000004 "VirtualDiskMaxTreeDepth"=dword:00000002 "VirtualDiskNoLocalMount"=dword:00000000

修正安裝過程的錯誤

HKEY_LOCAL_MACHINE/SYSTEM/setup


將以下 5 個項目的數值資料都改成 0

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\Setup] "OOBEInProgress"=dword:00000000 "SetupPhase"=dword:00000000 "SetupSupported"=dword:00000000 "SetupType"=dword:00000000 "SystemSetupInProgress"=dword:00000000

regedit 修正

shift + F10 開啟命令提示字元,並輸入 regedit 找到以下各項機碼並新增或修改;或是存成 .reg 檔,以指令匯入後刪除 .reg 檔:


隱藏檔案:

attrib +h "Secret Files" 

隱藏資料夾:

attrib +h f:\work 


顯示用"-"

顯示檔案:

attrib -h "Secret Files" 

顯示資料夾:

attrib -h f:\work 


https://www.minitool.com/news/how-to-hide-a-folder-in-windows-10.html


刪除資料夾及檔案

Echo batch file delete folder

@RD /S /Q "D:\testfolder"

https://www.get-itsolutions.com/create-batch-file-delete-folder-command-line/

https://www.get-itsolutions.com/how-to-list-files-in-cmd-command-prompt-windows-10/

https://www.delftstack.com/howto/batch/batch-file-delete-folder/#delete-a-folder-with-its-contents-manually-through-the-command-line


https://www.get-itsolutions.com/create-batch-to-delete-file-cmd/


指令:

https://www.tutorialspoint.com/batch_script/batch_script_deleting_folders.htm

https://www.youtube.com/watch?v=WJclVGet6WU

Name file diskpart.cmd


@echo off 

DISKPART /s C:\diskpart.txt 


--------------------------------------------------------

Name text file diskpart.txt  and change select disk to you USB drive.


SELECT DISK 2 

CLEAN 

CREATE PARTITION PRIMARY 

SELECT PARTITION 1 

ACTIVE 

FORMAT QUICK 

ASSIGN LETTER=E 

EXIT 



112.05

刪除D:\所有檔案,不含資料夾

@echo off

rd /s /q D:\

mkdir D:\ 

112.05.12

大神:這是我的另一個想法。

母碟base,子碟temp1平時用,temp2這個檔(4MB)拿來置換掉temp1,temp3設成還原選項,寫個置換掉+reboot的bat放在工作排程 or啟動,這個批次檔應該可以更少行。

這樣應該也是在還原選項key完密碼後,就可以走人了。