標籤

bat (54) 作品 (41) python (24) shell (17) windows (11) 虛擬機 (11) php (10) CPP (6) KMS (6) 程式設計 (6) docker (5) 使用教學 (5) xoops (4) 公文 (4) Apache2 (3) Excel (3) juniper (3) 資料庫 (3) 轉檔 (3) mysql (2) 免動手 (2) 資料結構 (2) 軟體廣播 (2) 電腦維修 (2) Android Studio (1) Apple IPAD管理 (1) Arduino (1) CSS (1) LAMP (1) NAS (1) Ubuntu (1) VHD (1) Windows Server (1) 原因 (1) 程式應用 (1) 程式積木 (1) 編輯器 (1) 雲端硬碟 (1)

2024年9月30日 星期一

只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF


        由於系列文章1~4 都是在Input資料夾內討論 Word 與 Pdf 互轉。面臨到資料夾內有子子孫孫資料夾,子子孫孫資料夾內有Word。那要如何將所有子子孫孫資料夾內的所有Word找出,並將之轉換成PDF?換句話說,可不可以有個程式,能夠將整理好的資料夾內所有Word 通通轉成PDF,即便資料夾內有很多個子資料夾,子資料夾內又有子資料夾。不管在哪個資料夾內的Word 都要將其找出並轉成PDF,轉出的PDF就在相對應的Word旁。

Since articles 1 to 4 discuss the conversion between Word and PDF within the Input folder, we are faced with the situation where there are nested subfolders containing Word documents. How can we find all the Word documents in these nested subfolders and convert them into PDF? In other words, is it possible to have a program that can convert all the Word documents in the organized folder, regardless of how many subfolders there are, and even if those subfolders contain their own subfolders? We need to find all the Word documents no matter where they are located within the folder structure and convert them into PDFs, with the resulting PDFs saved next to their corresponding Word files.

         下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):





2024年9月26日 星期四

只要點兩下,就可以開機後自動清除2024年彰化縣中小學電腦教室學生機電腦D槽內學生資料

         2024年彰化縣中小學電腦教室學生機的磁碟空間分成C、D兩個槽。由於C槽會進行開機還原,而D槽卻不會開機還原。因此,學生會將自己的資料存放在D槽。換言之,學生會利用D槽空間建置自己的娛樂,進而影響上課。如果放任學生對D槽存取資料,恐怕學生日後上資訊科技課便不再專心。希望在減輕資訊組長或維護電腦教室的人員工作負擔下,能夠讓其點兩下,就可以開機後自動清除電腦教室學生機D槽內學生資料。

         In 2024, the disk space of student computers in the computer classrooms of elementary and secondary schools in Changhua County is divided into two partitions: C and D. The C partition undergoes system restore on boot, while the D partition does not. Therefore, students tend to store their data on the D partition. In other words, students use the D partition to create their own entertainment, which can disrupt their focus during class. If students are allowed unrestricted access to the D partition, they may become inattentive in future information technology classes. We hope to reduce the workload of the IT coordinator or the personnel maintaining the computer classrooms, allowing them to simply double-click to automatically clear student data from the D partition after booting the computers.

         問題描述:如何在Windows 10 或 Windows 11 作業系統,在開機時自動執行系列文章1.只要點兩下,就可以一鍵清除2024年彰化縣中小學電腦教室學生機電腦D槽內學生資料。將系列文章1.只要點兩下,就可以一鍵清除2024年彰化縣中小學電腦教室學生機電腦D槽內學生資料。的程式放入開機執行的資料夾即可。開機執行的資料夾為%HomePath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\

       Problem Description: How to automatically execute a program on startup in Windows 10 or Windows 11 that can clear student data from the D partition of student computers in the computer classrooms of elementary and secondary schools in Changhua County with just a double-click. To achieve this, place the program that clears the student data into the startup folder. The startup folder is located at %HomePath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

         下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):



程式名稱:Move2StartUp.bat
程式內容:
@echo off
@echo off
REM :: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
REM :: BatchGotAdmin (Run as Admin code ends)
REM :: Your codes should start from the following line
move "%~dp0StuPCdelDall.exe" "%HomePath%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\"
pause
exit






只要點兩下,就可以一鍵清除2024年彰化縣中小學電腦教室學生機電腦D槽內學生資料

        2024年彰化縣中小學電腦教室學生機的磁碟空間分成C、D兩個槽。由於C槽會進行開機還原,而D槽卻不會開機還原。因此,學生會將自己的資料存放在D槽。換言之,學生會利用D槽空間建置自己的娛樂,進而影響上課。如果放任學生對D槽存取資料,恐怕學生日後上資訊科技課便不再專心。希望在減輕資訊組長或維護電腦教室的人員工作負擔下,能夠讓其點兩下,就可以一鍵清除電腦教室學生機D槽內學生資料。

        In 2024, the disk space of student computers in the computer classrooms of elementary and secondary schools in Changhua County is divided into two partitions: C and D. The C partition undergoes system restore on boot, while the D partition does not. Therefore, students tend to store their data on the D partition. In other words, students use the D partition to create their own entertainment, which can disrupt their focus during class. If students are allowed unrestricted access to the D partition, they may become inattentive in future information technology classes. We hope to reduce the workload of the IT coordinator or the personnel maintaining the computer classrooms, allowing them to simply double-click to automatically clear student data from the D partition after booting the computers.

        咦!電腦內原本就有直接清除D槽資料的方法。不就是對準D槽,按滑鼠右鍵。就會出現下拉是選單,點選格式化:

        Oh! There is already a method to directly clear the data on the D partition in the computer. Just right-click on the D partition, and a dropdown menu will appear. Then select "Format."

點選開始,就可以了。
Just click on "Start," and you're good to go.
而且格式化的速度還不賴。很快就能進行下一台電腦的清除資料。那幹嘛還要進行開發?
Moreover, the formatting speed is quite good. You can quickly proceed to clear the data on the next computer. So why do we still need to develop a program?

        問題描述:D槽空間原本就有兩個基本資料夾,這兩個資料夾名稱分別是os 與ventoy。如果對D槽進行快速格式化,這兩個資料夾就會被格式化掉。接下來就會導致系統崩潰。希望這兩個資料夾能夠保留,並且清空D槽內學生自建資料。

        Problem Description: The D partition originally contains two basic folders named "os" and "ventoy." If a quick format is performed on the D partition, these two folders will be erased, which could lead to system crashes. We hope to retain these two folders while clearing out the student-created data within the D partition.

         下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):





2024年1月25日 星期四

只要點兩下,傳統右鍵選單改回Win11右鍵選單

上一篇提到只要點兩下,就能將Win11選單回到傳統選單。但是有沒有方法能夠回到Win11選單呢?
         
         下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):



檔案名稱:傳統右鍵選單改回Win11右鍵選單.bat
檔案內容:
@echo off
REM :: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
REM :: BatchGotAdmin (Run as Admin code ends)
REM :: Your codes should start from the following line
reg add HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32 /f /ve
shutdown /r /f /t 0

只要點兩下,就能將Win11 右鍵選單 回復 傳統右鍵選單

系列文章:

         It's so frustrating! Every time I use the right-click menu in Windows 11, I have to take an extra step to get back to the traditional menu. Especially when compressing or extracting files, it feels like an unnecessary extra step. Is there any way to go back to the traditional menu? I hope to find a method to revert to the traditional menu.
        好辛苦!,每次用Windows 11 的右鍵選單,都還要再多一步,才能回到傳統選單。特別是壓縮檔案或是解壓縮檔案,都會覺得多一步很麻煩,難道沒有方法能夠回到傳統選單?希望能找到方法回到傳統選單。
         下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):



檔案名稱:Win11右鍵選單改回傳統右鍵選單.bat
檔案內容:
@echo off
REM :: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
REM :: BatchGotAdmin (Run as Admin code ends)
REM :: Your codes should start from the following line
reg add HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32 /f /ve
shutdown /r /f /t 0

2023年12月20日 星期三

只要點兩下,就能在Windows 10 建立Tello Scratch 2.0積木環境(安裝AdobeAIR、Scratch 2.0、node.js )

         最近要教學生玩Tello Edu版,還想要讓學生用Scratch 寫程式。查詢網路資料,發現步驟有點麻煩。希望能夠用簡易的方式來完成設定,最好是能夠用點兩下,就能夠完成安裝與設定。這時,才驚覺可以用BAT來完成。因此,只要點兩下,就能在Windows 10 建立Tello Scratch 2.0積木環境(安裝AdobeAIR、Scratch 2.0、node.js ) 
         下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):

        

         以下是開發過程與原始碼 (Development process and code):
        從資料來源1.從安裝到使用 Scratch 寫程式控制 Tello,我們大抵知道手動安裝的順序。安裝順序如下:
1.下載


    (2)Node.js
    (3)Tello Scratch2.0
         點選Tello Scratch2.0,就會進行下載,檔名為Release.zip。
         解壓縮後,就可以看到Release\內有Scratch資料夾
         Release\Scratch資料夾內有三個檔案:Tello.js、Tello.s2e、TelloChs.s2e

2.安裝
   1.將Adobe AIRScratch 2.0 離線版Node.js 的安裝程式放置到TelloScratch20\Program資料夾
   2.將Release\Scratch更名為tello,放置到TelloScratch20\
    那我們寫成一個BAT,檔名為TelloScratch20.bat
    檔案內容為:
@echo off
REM --------------以下為設定檔-可修改--------------
set driver01_64=%~dp0Program\AdobeAIR.exe
set driver02_64=%~dp0Program\Scratch-461.exe
set driver03_64=%~dp0Program\node-v20.10.0-x64.msi

REM ----------------以下為程式碼-可修改--------------
REM 安裝 AdobeAIR
start/wait %driver01_64%
echo 安裝 %driver01_64% OK 

REM 安裝 Scratch
start/wait %driver02_64%
echo 安裝 %driver02_64% OK 

REM 安裝 Node 
msiexec /package %driver03_64%
echo 安裝 %driver03_64% OK

REM 在C槽建立tello 資料夾 
md C:\tello\
REM 將隨身碟tello資料夾內的檔案,複製到C槽tello資料夾
copy %~dp0tello C:\tello\
echo 複製隨身碟內tello 到 C:\tello OK

REM 以Node啟動C槽tello資料夾內的 Tello.js
"C:\Program Files\nodejs\node.exe" C:\tello\Tello.js  
Pause
exit



2023年10月18日 星期三

只要點兩下,就能將放進input的一堆PDF轉成在ouput資料夾內的各自的WORD


        By simply double-clicking, you can convert a bunch of PDF files that are placed in the input folder into their respective Word documents, which will be located in the output folder.

        根據上篇只要點兩下,就能將放進input的一堆PDF轉成各自的WORD,發現產出的WORD會跟執行程式PDFTOWORD.exe混在一起。當轉換的檔案多了,恐怕要用人工去一一核對,造成不便。如果產出的產出的WORD會集中在一個output資料夾,只要移動output資料即可。
 
        According to the previous article, by simply double-clicking, you can convert a bunch of PDF files that are placed in the input folder into their respective Word documents. However, it was found that the generated Word documents are mixed with the execution program PDFTOWORD.exe. When there are multiple converted files, it might be inconvenient to manually check each one. To address this issue, if the generated Word documents are centralized in an output folder, you can simply move the output folder.

下載檔案解壓密碼:demo1234
Here is the website where you can download the program and find instructions:
Download。Extraction Password: demo1234
使用教學(Instructional videos):
 


以下是開發過程與原始碼 (Development process and code):
 
安裝pdf2docx套件(Install the pdf2docx suite)
指令(command):pip install pdf2docx
 
程式名稱(Program name):PdfToWord01.py
程式內容(Code):
#請安裝套件 pdf2docx
#指令 pip install pdf2docx
from pdf2docx import Converter
import os

#取得當前目錄
Path = os.getcwd()
#取得input路徑
InputPath = Path+'\\input\\'
#取得input資料夾下的目錄或檔案
dirs = os.listdir(InputPath)
#檢查目錄是否存在
if os.path.exists(Path+'\\output'):
    #印出output資料夾存在
    print(Path+'\\output'+' exists!')
else:
    #建立output資料夾
    os.makedirs(Path+'\\output')

if dirs != []:
    for dir in dirs:
        fileName,fileExt = dir.split('.')
        if fileExt.lower() == 'pdf':
            PdfCvWord = Converter(InputPath+dir)
            PdfCvWord.convert(Path+'\\output\\'+fileName+'.docx')
            PdfCvWord.close()
else:
    print('Input is empty!!')



只要點兩下,就能夠將InputAndOutput資料夾底下的子子孫孫資料夾內所有Word通通轉成PDF

  系列文章: 1. 只要點兩下,就能將一堆的Doc與Docx 轉成 PDF 1. https://skjhcreator.blogspot.com/2023/05/docdocx-pdf.html 2. 只要點兩下,就能將一堆的JPG轉成一個PDF,並以JPG所在的資料夾名稱為...