<commit_before>::通过使用短文件路径，支持放在Unicode路径下。
@echo off
cd /d %~dps0
set WD=%CD%
echo %WD%

:: --> Check for permissions
net session >nul 2>&1
:: --> If error flag not set, we do have administrator permission.
if %errorLevel% == 0 (
    goto gotAdmin
)

echo %~dpnxs0
call request-admin.bat %~dpnxs0 & exit /B

:gotAdmin
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f 

:SYSTEMROOT
set NotepadFolder=%SYSTEMROOT%
set NEXT=SYSTEM32
goto RecoverNotepad

:SYSTEM32
set NotepadFolder=%SYSTEMROOT%\SYSTEM32
set NEXT=SysWOW64
goto RecoverNotepad

:SysWOW64
set NotepadFolder=%SYSTEMROOT%\SysWOW64
set NEXT=end
goto RecoverNotepad

:RecoverNotepad
if not exist %NotepadFolder%\notepad.NotepadStarter.exe (goto %NEXT%)
takeown /f %NotepadFolder%\notepad.exe
icacls %NotepadFolder%\notepad.exe /grant "%USERNAME%":f
copy %NotepadFolder%\notepad.NotepadStarter.exe %NotepadFolder%\notepad.exe /y

::call :date_to_number "%NotepadFolder%\notepad.NotepadStarter.exe" var1 
call :myGetFunc var1 "%NotepadFolder%\notepad.NotepadStarter.exe"

echo %var1%

goto %NEXT% 

:end

pause

goto :eof
:date_to_number
if "%~1" EQU "" goto :eof
if "%~2" EQU "" goto :eof
setlocal
rem for %a in ("%~2") do set FileDate=%~ta
endlocal & set "%~2=%~1"


goto :eof
:myGetFunc    - passing a variable by reference
if "%~1" EQU "" goto :eof
if "%~2" EQU "" goto :eof
set "%~1=%~2"
goto:eof
	<commit_msg>detecting time finished. delete the new NotepadStarter.exe file first, then copy the original notepad.exe back.<commit_after>::通过使用短文件路径，支持放在Unicode路径下。
@echo off
cd /d %~dps0
set WD=%CD%
echo %WD%

:: --> Check for permissions
net session >nul 2>&1
:: --> If error flag not set, we do have administrator permission.
if %errorLevel% == 0 (
    goto gotAdmin
)

echo %~dpnxs0
call request-admin.bat %~dpnxs0 & exit /B

:gotAdmin
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f 

:SYSTEMROOT
set NotepadFolder=%SYSTEMROOT%
set NEXT=SYSTEM32
goto RecoverNotepad

:SYSTEM32
set NotepadFolder=%SYSTEMROOT%\SYSTEM32
set NEXT=SysWOW64
goto RecoverNotepad

:SysWOW64
set NotepadFolder=%SYSTEMROOT%\SysWOW64
set NEXT=end
goto RecoverNotepad

:RecoverNotepad
if not exist %NotepadFolder%\notepad.NotepadStarter.exe (goto %NEXT%)
takeown /f %NotepadFolder%\notepad.exe
icacls %NotepadFolder%\notepad.exe /grant "%USERNAME%":f
del %NotepadFolder%\notepad.exe
echo errorlevel=%errorlevel%
if not %errorLevel% == 0 (
    goto %NEXT%
)
copy %NotepadFolder%\notepad.NotepadStarter.exe %NotepadFolder%\notepad.exe /y
call :date_to_number time1 "%NotepadFolder%\notepad.exe"
echo "%NotepadFolder%\notepad.exe"=%time1%
call :date_to_number time2 "%NotepadFolder%\notepad.NotepadStarter.exe"  
echo "%NotepadFolder%\notepad.NotepadStarter.exe"  =%time1%

if "%time1%" EQU "%time2%" ( 
  del "%NotepadFolder%\notepad.NotepadStarter.exe"
)
goto %NEXT% 

:end

pause

goto :eof
:date_to_number    - passing a variable by reference
if "%~1" EQU "" goto :eof
if "%~2" EQU "" goto :eof
setlocal
for %%a in ("%~2") do set "FileDate=%%~tza"
echo Calculating "%~2" %FileDate%
endlocal & set "%~1=%FileDate%"
goto:eof
{'fraction_non_alphanumeric': 0.13169502205419029, 'fraction_numerical': 0.01890359168241966, 'mean_word_length': 5.388329979879276, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6408328', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1245, 'n_words': 315}