|
我的外罝法如下, 給你參考
每次執行下列 batch , 便在 %cd_apps% 搜索所謂外置目錄, 生成捷徑.
我主要用於收藏下來的應用程式, 1 張dvd 放他 4 gb. photoshop cs 也照跑.
1張dvd 不夠, 插入另一張再執行一次好了.
@echo off
:: 目的:
:: 讀取 %cd_apps% 目錄下的任何 !.cmd 生成 link , 以同目錄的 ico (優先), exe 作 link icon.
:: 不以 ! 開頭的 cmd 文件, 將不生成 link.
:: icon 是 減去 ! 後 同名的 ico, exe.
:: 原 cmd 由 Wuyou 論壇某大師所作.
echo 建立捷徑中....
if exist %drv%\xLink.ini (pecmd.exe load %drv%\xLink.ini&exit)
if exist %temp%\xLink.ini (del %temp%\xLink.ini)
cd.>%temp%\xLink.ini
if "%1"=="" (set route=%cd_apps%) else set route=%~dp1
REM %route:~第幾個字符開始),取多少個字符%
rem if not exist %route:~0,2%\ext.ini echo %route:~0,2% 下沒有 ext.ini 文件&pause&exit
if not exist ext.ini echo 現行目錄沒有 ext.ini 文件&pause&exit
rem for /f "delims=" %%i in (%route:~0,2%\ext.ini) do call set str=%%str%% %route%\%%i
set str=
rem for /f "delims=" %%i in (ext.ini) do call set str=%%str%% %route%\%%i
rem we only want !*.cmd
for /f "delims=" %%i in (ext.ini) do call set str=%%str%% %route%\!%%i
echo rout = [%route%] > b:\ddir.txt
echo str=[%str%] >> b:\ddir.txt
echo dir /a-d /b /s %str% >> b:\ddir.txt
dir /a-d /b /s %str% >> b:\ddir.txt
for /f "delims=" %%i in ('dir /a-d /b /s %cd_apps%\!%str%') do call :pickup %%~pi %%~dpi %%~ni %%~xi
rem start %temp%\xLink.ini
echo loading %temp%\xLink.ini ....
dir "%UserProfile%\「開始」功能表\程式集\光盤%cd_apps:~0,1%程式捷徑" /ad 2>nul|find.exe "光盤%cd_apps:~0,1%程式捷徑"
if %errorlevel% == 0 (rd /s /q "%UserProfile%\「開始」功能表\程式集\光盤%cd_apps:~0,1%程式捷徑")
dir "%UserProfile%\桌面\光盤%cd_apps:~0,1%程式捷徑" /ad 2>nul|find.exe "光盤%cd_apps:~0,1%程式捷徑"
if %errorlevel% == 0 (rd /s /q "%UserProfile%\桌面\光盤%cd_apps:~0,1%程式捷徑")
pecmd.exe load %temp%\xLink.ini
goto :eof
:pickup
set p_file=%1
set p_file=%p_file:~1,-1%
set route_tmp=%p_file:*\=%
set dp_file=%2
set n_file=%3
set x_file=%4
rem if exist %dp_file%%n_file%.ico (set "switch=^,^,%route:~0,2%\%p_file%\%n_file%.ico") else if exist %dp_file%%n_file%.exe set "switch=^,^,%route:~0,2%\%p_file%\%n_file%.exe"
if exist %dp_file%%n_file%.ico (set "switch=^,^,%route:~0,2%\%p_file%\%n_file%.ico") else if exist %dp_file%%n_file:~1,128%.exe set "switch=^,^,%route:~0,2%\%p_file%\%n_file:~1,128%.exe"
REM echo LINK %%Programs%%\%route_tmp%\%n_file%,%%CurDrv%%\%p_file%\%n_file%%x_file%%switch%>>%temp%\xLink.ini
rem echo LINK %%UserProfile%%\「開始」功能表\程式集\光盤%route:~0,1%程式捷徑\%n_file%,%route:~0,2%\%p_file%\%n_file%%x_file%%switch%>>%temp%\xLink.ini
echo LINK %%UserProfile%%\「開始」功能表\程式集\光盤%route:~0,1%程式捷徑\%route_tmp%\%n_file%,%route:~0,2%\%p_file%\%n_file%%x_file%%switch%>>%temp%\xLink.ini
rem LINK %UserProfile%\桌面\光盤d程式捷徑\a1cd_Apps\lc5\a2!LC5,a3d:\a4tmp\cd_Apps\lc5\a5!LC5a6.cmda7,,d:\tmp\cd_Apps\lc5\LC5.exe
rem echo LINK %%UserProfile%%\桌面\光盤%route:~0,1%程式捷徑\a1%route_tmp%\a2%n_file%,a3%route:~0,2%\a4%p_file%\a5%n_file%a6%x_file%a7%switch%>>%temp%\xLink.ini
echo LINK %%UserProfile%%\桌面\光盤%route:~0,1%程式捷徑\%route_tmp%\%n_file%,%route:~0,2%\%p_file%\%n_file%%x_file%%switch%>>%temp%\xLink.ini
set switch=
goto :eof
而 wim , 我則於做 U 盤時, 作為動二次載入系統用. (其實也可用其它格式)
本人一向是用非精簡PE, 約 400 ~ 500 mb , 把可以後期加載的文件, 放於wim , 啟動到桌面時再 mount 該 wim, 這樣一個全功能的 pe 約 230 mb , 壓成 IS_ 後小於 80mb. 餘下的2xx mb 文件以 wim放式加載用不了多小ram.
雖然沒大師精簡的小及好. 但控制台, 服務待, 全有. |
|