
[已解決]求精減批處理循環(huán)寫法之前這樣寫
- ::處理鎖屏
- if exist %1lockscreenadvance (xcopy /e /i /y%1lockscreenadvance %~dp0advance
- copy %1lockscreenadvancemanifest.xml %~dp0
- cd /d %~dp0
- PowerShell -exec ByPass &'%~dp01.ps1' %~f1lockscreenadvance
- ::call 1.bat
- move %~dp01.xml %1lockscreenadvancemanifest.xml
- )>nul
- ::處理時鐘
- if exist %1clock_2x4 (xcopy /e /i /y%1clock_2x4 %~dp0clock_2x4
- copy %1clock_2x4manifest.xml %~dp0
- cd /d %~dp0
- PowerShell -exec ByPass &'%~dp01.ps1' %~f1clock_2x4
- move %~dp01.xml %1clock_2x4manifest.xml
- )>nul
- ::處理動態(tài)壁紙
- if exist %1miwallpaper (xcopy /e /i /y%1miwallpaper %~dp0miwallpaper
- copy %1miwallpapermanifest.xml %~dp0
- cd /d %~dp0
- PowerShell -exec ByPass &'%~dp01.ps1' %~f1miwallpaper
- move %~dp01.xml %1miwallpapermanifest.xml
- )>nul
nclick="copycode($('code0'));">復(fù)制代碼
感覺還能精減
- ::處理鎖屏、時鐘、動態(tài)壁紙、自由桌面
- if exist %1lockscreenadvance (set smss=lockscreenadvance&goto C)
- if exist %1clock_2x4 (set smss=clock_2x4&goto C)
- if exist %1miwallpaper (set smss=miwallpaper&goto C)
- if exist %1com.miui.home.freestyle(set smss=com.miui.home.freestyle&goto C)
- goto D
- :C
- ::echo%1%smss%
- xcopy /e /i /y%1%smss% %~dp0%smss%
- copy %1%smss%manifest.xml %~dp0
- cd /d %~dp0
- PowerShell -exec ByPass &'%~dp01.ps1' %~f1%smss%
- ::call 1.bat
- move %~dp01.xml %1%smss%manifest.xml
- if %smss% == com.miui.home.freestyle (goto D)
- if exist %1clock_2x4 (if %smss% NEQ clock_2x4 (set smss=clock_2x4&goto C)
- )
- if exist %1miwallpaper (if %smss% NEQ miwallpaper (set smss=miwallpaper&goto C)
- )
- if exist %1com.miui.home.freestyle (if %smss% NEQ com.miui.home.freestyle (set smss=com.miui.home.freestyle&goto C)
- )
- goto D
- :D
- echo%1%smss%OK
nclick="copycode($('code1'));">復(fù)制代碼