首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > windows >

求教批处理下令不能执行

2012-07-31 
求教批处理命令不能执行我想用批处理命令执行桌面文件移动,具体如下:@echo offif exist C:\Documents and

求教批处理命令不能执行
我想用批处理命令执行桌面文件移动,具体如下:

@echo off
if exist C:\Documents and Settings\user\桌面\*.txt move C:\Documents and Settings\user\桌面\*.txt C:\Documents and Settings\user\桌面\备份

但执行命令无效,我试过将命令改为

@echo off
if exist C:\新建文件夹\*.txt move C:\新建文件夹\*.txt C:\备份\*.txt

可以执行,所以不知最上面的命令有什么不对,为什么不能执行,求教各位大侠,望不吝赐教,谢谢!

[解决办法]
如果包含空格,要用引号括起来。
试试:
if exist "C:\Documents and Settings\user\桌面\*.txt" move "C:\Documents and Settings\user\桌面\*.txt" "C:\Documents and Settings\user\桌面\备份"

热点排行