2025年5月7日 星期三

輸出拖曳資料夾中所有檔案 dir all subfolder files in specific folder by dragging

 rem @ECHO OFF

SET targetPath="%~1"

SET ToolPath=%~dp0


REM Method 0: work fine

REM FOR /F "delims=" %%I IN ('cmd /c echo %targetPath%') do SET deepest_folderName=%%~nxI


FOR /F "delims=" %%I IN (%targetPath%) do SET deepest_folderName=%%~nxI


dir %targetPath% /b /s /a-d > "%ToolPath%%deepest_folderName%-list.txt"

pause




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

tree /f>filelist.txt

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

reference:

https://superuser.com/questions/32771/list-all-files-in-all-subfolders

取得批次檔所在目錄 get current folder name by batch command

@echo off


REM 取得批次檔所在目錄(含反斜線)

SET fullPath=%cd%


REM 取得最底層資料夾名稱

FOR /F "delims=" %%I IN ('cmd /c echo %fullPath%') DO SET folderName=%%~nxI


REM 顯示結果

ECHO folder full path: %fullPath%

ECHO folder name: %folderName%


PAUSE

2025年4月25日 星期五

語音轉文字工具 WhisperDesktop / pufview's faster-whisper

語音轉文字工具


WhisperDesktop

https://github.com/Const-me/Whisper


BUZZ

https://github.com/chidiwilliams/buzz


pufview's faster-whisper

https://github.com/Purfview/whisper-standalone-win




2025年4月9日 星期三

find findstr 用法

查找此目錄底下所有jpg檔案

dir /s | find "JPG"

dir /s |  findstr .JPG


systeminfo | find "實體記憶體總計"

systeminfo | findstr 記憶體總計

2025年2月17日 星期一

veyon remote launch program

---launch Minecraft---

explorer.exe shell:appsFolder\\Microsoft.4297127D64EC6_8wekyb3d8bbwe!Minecraft


 ---備份D槽所有資料 with 7zip---

"c:\Program Files\7-Zip\7z.exe" a C:\20250214\d-backup.zip D:\*


---刪除D槽所有資料--- warning!!!!   all data in d:\ will be lost

cmd /c "rmdir /s /q D:\"


---大量派送---(搭配HFS使用)

curl -s -o C:\test\mods.7z http://10.x.x.x/mods.7z



veyon config :

C:\Users\xxx\AppData\Roaming\Veyon\Config\VeyonMaster.json

2024年9月26日 星期四

Word 合併列印 數字改為國字大寫 with excel

參考資料:https://fjanchen.blogspot.com/2010/11/blog-post_17.html


Word僅接受原始格式的文字,不接受Excel畫面上的格式設定,所以無法使用Excel的數值類型來設定數字的呈現格式.


在excel中處理:

1.必須要使用函數,確實將數字更改為大寫文字的文字型態,方能在Word中呈現出正確的數字

2.設定函數的方式為: =TEXT(原數字儲存格,"[DBNum2]")

3.其中的[DBNum2]代表國字大寫數字的格式定義


在word中處理:

1..滑鼠進入  數字  會出現反灰

2.按Shift- F9 會出現{ MERGEFIELD "數字" }

3.點進去 改成 { MERGEFIELD "數字" \* CHINESENUM2 }

4.按 F9 ,完成。


 word中其他格式:

\# 後面接的是數值性資料的格式

\@ 後面接的是日期性資料的格式

\*後面可接特殊的中文數字表示格式


譬如:

{ “合併欄位” \# NT$#,###.## }  將會顯示NT$12,345.78

{ “合併欄位” \* DBNUM1 }  將會顯示一二三四五六

{ “合併欄位” \* DBNUM2 }  將會顯示壹拾貳萬參仟肆佰伍拾陸

{ “合併欄位” \* DBNUM3 }  將會顯示一十二萬三千四百五十六


2024年7月8日 星期一

Using cmd powershell to du sub folders (Get sub folders size) 計算子目錄容量

powershell -command "$fso = new-object -com Scripting.FileSystemObject; gci -Directory -Depth 3 | select @{l='Size'; e={$fso.GetFolder($_.FullName).Size}},FullName | sort Size -Descending | ft @{l='Size [MB]'; e={'{0:N2}    ' -f ($_.Size / 1MB)}},FullName"


powershell -command "$fso = new-object -com Scripting.FileSystemObject; gci -Directory -Depth 2 | select @{l='Size'; e={$fso.GetFolder($_.FullName).Size}},FullName | sort Size -Descending | ft @{l='Size [KB]'; e={'{0:N2}    ' -f ($_.Size / 1KB)}},FullName"


powershell -command "$fso = new-object -com Scripting.FileSystemObject; gci -Directory -Depth 2 | select @{l='Size'; e={$fso.GetFolder($_.FullName).Size}},FullName | sort Size -Descending | ft @{l='Size [KB]'; e={'{0:N2}    ' -f ($_.Size / 1000)}},FullName"



reference:

https://stackoverflow.com/questions/12813826/get-folder-size-from-windows-command-line

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.4


 Get-Content x.log -Wait -Tail 100

2024年2月17日 星期六

Using command line download google Chrome browser 免IE瀏覽器 使用命令列下載chrome瀏覽器

### cURL (Windows 10 built-in)
curl -fsSL "http://dl.google.com/chrome/install/chrome_installer.exe" > ChromeSetup.exe


### PowerShell Script 
powershell -Command "(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/chrome_installer.exe','ChromeSetup.exe')"

2023年12月18日 星期一

Launch Microsoft Store apps from Command Prompt


Open Microsoft Store from Run

explorer.exe ms-windows-store:

Open Microsoft app from Run

explorer.exe shell:appsFolder\<PackageFamilyName>!<App ID>
explorer.exe appInstallLocation\executable file (various location by app version)


find out apps name in shortcut detail properties

e.g.  minecraft launcher is Microsoft.4297127D64EC6_8wekyb3d8bbwe 



find appInstallLocation:

1.using powershell type  get-appxpackage > c:\findout.txt

2.find  app’s PackageFamilyName (Microsoft.4297127D64EC6_8wekyb3d8bbwe)
copy InstallLocation paste to file browser

3. open AppxManifest.xml in InstallLocation


find Application Id & Executable file in AppxManifest.xml