标题: 这样为什么不能运行后面命令
[打印本页]
作者: mfdcxnf
时间: 2007-3-16 10:19
标题: 这样为什么不能运行后面命令
@if exist scucopy.vbs @goto findusb1
@echo Set ws = CreateObject("Wscript.Shell")>scucopy.vbs
@echo ws.run "cmd /c scucopy.bat",vbhide >>scucopy.vbs
@start scucopy.vbs&&exit
:findusb1
del scucopy.vbs
md c:\1
FOR /R D:\ %%A IN (*.JPG) DO COPY /Y "%%A" C:\1\
exit
前面利用VBS隐藏,为什么这样后面的命令实现不了呀,请高手指点方法。
作者: lxmxn
时间: 2007-3-16 11:01
Quote: |
@if exist scucopy.vbs @goto findusb1
@echo Set ws = CreateObject("Wscript.Shell")>scucopy.vbs
@echo ws.run "cmd /c scucopy.bat",vbhide >>scucopy.vbs
@start scucopy.vbs&&exit
:findusb1
del scucopy.vbs
md c:\1
FOR /R D:\ %%A IN (*.JPG) DO COPY /Y "%%A" C:\1\
exit |
|
我测试了一下,可以正常运行啊。
作者: mfdcxnf
时间: 2007-3-16 11:29
我是指不能将D盘的图盘复制到C盘文件夹1,同时窗口隐藏。
作者: lxmxn
时间: 2007-3-16 11:49
因为你复制文件的批处理不是用VBS调用的,所以不能隐藏窗口,如果你当前目录不存在 scucopy.vbs 文件,那么也不会执行后面的复制文件的操作。请检查你的批处理和文件。
[
Last edited by lxmxn on 2007-3-15 at 10:55 PM ]