对于 IF 语句 returns "Files was unexpected at this time."
For IF statement returns "Files was unexpected at this time."
我一直在努力寻找解决这个问题的办法。
我的批处理文件在桌面上运行良好,但在程序文件夹中不起作用。我已经取得了该文件夹的所有权,以防出现问题但没有修复它。
我 运行 以下脚本,但 returns "Files was unexpected at this time." 在 FOR 行。
:SearchSame
set location=%cd%
goto Search
:Search
setlocal EnableDelayedExpansion
cls
echo.
Echo. Searching for .exe files in %location% and its subfolders
echo.
set /a count=0
echo.___________________________________________
echo.Found:
echo.
FOR /R %location% %%i in (*.exe) do (set /a count+=1 & IF !count! lSS 10 "(echo. !count!. %%~ni)" else "(echo. !count!.%%~ni)")
echo.___________________________________________
echo.
IF %count% EQU 0 (
title Exe blocker - No Files Found! & cls & echo. & echo. Exe Blocker was unable to find any files with .exe extention in the folder & echo. location of %location% or subfolders. & echo. & echo. Please check the folder and search again & echo. & Pause & goto Start
) ELSE (
title Exe blocker - Showing %count% Exe Files ) & echo. Number of files found with .exe extention: %count%
)
echo.
echo.
我在回声周围添加了“”。在 FOR 循环中计数,但这并没有解决问题。
我是 运行宁 windows 10 - 它在 windows 8.1.
上运行良好
为您的帮助干杯!
这是 "Program Files" 的 "Files"。
尝试在%location%
周围加上“”
我一直在努力寻找解决这个问题的办法。 我的批处理文件在桌面上运行良好,但在程序文件夹中不起作用。我已经取得了该文件夹的所有权,以防出现问题但没有修复它。
我 运行 以下脚本,但 returns "Files was unexpected at this time." 在 FOR 行。
:SearchSame
set location=%cd%
goto Search
:Search
setlocal EnableDelayedExpansion
cls
echo.
Echo. Searching for .exe files in %location% and its subfolders
echo.
set /a count=0
echo.___________________________________________
echo.Found:
echo.
FOR /R %location% %%i in (*.exe) do (set /a count+=1 & IF !count! lSS 10 "(echo. !count!. %%~ni)" else "(echo. !count!.%%~ni)")
echo.___________________________________________
echo.
IF %count% EQU 0 (
title Exe blocker - No Files Found! & cls & echo. & echo. Exe Blocker was unable to find any files with .exe extention in the folder & echo. location of %location% or subfolders. & echo. & echo. Please check the folder and search again & echo. & Pause & goto Start
) ELSE (
title Exe blocker - Showing %count% Exe Files ) & echo. Number of files found with .exe extention: %count%
)
echo.
echo.
我在回声周围添加了“”。在 FOR 循环中计数,但这并没有解决问题。
我是 运行宁 windows 10 - 它在 windows 8.1.
上运行良好为您的帮助干杯!
这是 "Program Files" 的 "Files"。
尝试在%location%