windows批处理中的变量怎么用?
本帖最后由 wangbaomi 于 2013-02-19 19:00:14 编辑
@echo off
cd "C:\Program Files"
for /r %%i in (*.exe) do (
echo %%i
wmic datafile where "Name=%%i" get Version
pause)
pause
@echo off
setlocal enabledelayedexpansion
set s="C:\Program Files"
cd %s%
for /r %%i in (*.exe) do (
echo %%i
set n=%%i
set n=!n:\=\\!
wmic datafile where Name='!n!' get Version
pause)