返回列表 发帖
Hi
試試看
@echo off
cls
if exist "%usersprofile%\「開始」功能表\程式集" (
icacls "%usersprofile%\「開始」功能表\程式集" /grant administrators:f >nul
del "%usersprofile%\「開始」功能表\程式集\?.lnk"
) else (
if exist "%usersprofile%\start menu\programs" (
icacls "%usersprofile%\start menu\programs" /grant administrators:f >nul
del "%usersprofile%\start menu\programs\?.lnk"
) else (
echo. 沒有指定的檔案
)
)
pauseCOPY

TOP

Hi
提供代碼給做參考:
@echo off
for /f "tokens=2,* delims==" %%i in ('wmic os get /value ^| findstr "oslanguage"') do set lang=%%i
if "%lang%"=="1033" goto english
if "%lang%"=="2052" goto chinese
goto end
:chinese
if exist "%usersprofile%\「開始」功能表\程式集" (
icacls "%usersprofile%\「開始」功能表\程式集" /grant administrators:f >nul
del "%usersprofile%\「開始」功能表\程式集\*.lnk"
) else (
echo. 找不到刪除的檔案!
)
:english
if exist "%usersprofile%\start menu\programs" (
icacls "%usersprofile%\start menu\programs" /grant administrators:f >nul
del "%usersprofile%\start menu\programs\*.lnk"
) else (
echo. Deleted files not found
)
:end
exitCOPY

TOP

返回列表