这就是我尝试执行一些基本文件操作但代码cmd提示只是循环而不执行任何活动或启动任何程序。
:loop
if not exist C:\Scanned\1.pdf GOTO LOOP
if exist C:\Scanned\1.pdf GOTO command
:command
if exist C:\Program Files\Microsoft\outlook.exe START outlook.exe /c /a C:\Scanned\1.pdf MOVE /Y C:\Scanned\1.pdf C:\Recieved
if exist C:\Program Files\"Mozilla Thunderbird"\thunderbird.exe START thunderbird.exe -compose attachment= C:\Scanned\1.pdf MOVE /Y C:\Scanned\1.pdf C:\Recieved
GOTO LOOP
答案 0 :(得分:0)
:loop
if not exist "C:\Scanned\1.pdf" GOTO LOOP
if exist "C:\Program Files\Microsoft\outlook.exe" (
echo here the outlook sending code
) else if exist "C:\Program Files\Mozilla Thunderbird\thunderbird.exe" (
echo here the thunderbird sending code
)
move /y "c:\scanned\1.pdf" "c:\received"
goto LOOP
作为一般规则,必须引用带空格的文件/路径。