@echo off
if not "%~1"=="" (
del %1
pause
) else (
echo.
echo 请拖入准备删除的文件到这个BAT
echo.
pause
)
感谢大家的帮助
[ Last edited by huzixuan on 2007-1-31 at 03:55 AM ]作者: NaturalJ0 时间: 2007-1-31 00:15 用引号,像这样。
"C:\Documents and Settings\J\桌面\apploc.msi"作者: electronixtar 时间: 2007-1-31 00:25 如果没记错的话
if not "%1"==""
改成
if not [%1]==[]作者: NaturalJ0 时间: 2007-1-31 00:29 我在上面回的不对,改成这样。
if not "%~1"==""作者: huzixuan 时间: 2007-1-31 00:38 @echo off
if not [%1]==[] (
del "%1"
pause
) else (
echo.
echo 请拖入准备删除的文件到这个BAT
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo 注意: 文件名中不能有空格!!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo.
pause
)
还是不行哦作者: redtek 时间: 2007-1-31 01:04 兄这条命令 del "%1" 本意中是正确的~:)