clautton 发表于 2016-10-27 16:48:51

请教因何有时会找不到文件的?

请教因何有时会找不到文件的?

我的是Windows 7 Pro x64, 我用OneShipping.bat, 里面内容是:
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Move File = Time Stamp.exe" P:\Temp\*.html P:\
Taskkill /f /im "Move File = Time Stamp.exe"
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Window Control.exe" "The Bat!" "K"
if not exist "P:\Wait.html" Taskkill /f /im "Goto Popup Click Botton.exe"
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Popup Click Botton.exe" "Browse For Folder" "OK"
if not exist "P:\Wait.html" Taskkill /f /im "Goto Popup Click Botton.exe"
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Popup Click Botton.exe" "Extract Attachments" "&Increment the file name"
if not exist "P:\Wait.html" Taskkill /f /im "Goto Popup Click Botton.exe"
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Popup Click Botton.exe" "Extract Attachments" "&OK"
if not exist "P:\Wait.html" Taskkill /f /im "Goto Window Control.exe"
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Window Control.exe" "The Bat!" "X"
if not exist "P:\Wait.html" Del /f /s /q P:\"Temp\*.xls"
if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\TheBat Save Message.html = OneShipping.bat.exe"
if not exist "P:\Wait.html" Start /min D:\"Pro-InstallED\My = Profit\Invoice To My-Gold.bat" ^& exit
if exist "P:\Wait.html" Start /B P:\Temp\Invoice=DONE.xls
if exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Window Control.exe" "Microsoft Excel - Invoice=DONE.xls" "L"
if not exist "P:\Wait.html" Copy P:\Temp\Message.html P:\Wait.html /Y

我每天都会手动的运行这OneShipping.bat七十至120次, 但每天都会有1-8次出现如下, 说找不到Move File = Time Stamp.exe, Goto Popup Click Botton.exe, Goto Window Control.exe这三个文件, 但这三个文件一直都在:

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Move File = Time Stamp.exe" P:\Temp\*.html P:\
Move File Program. Build Time: 3/16/2016 5:52:54 PM.
ERROR: No Source File found
Usage: MoveFile <Source File/Folder> <Destination Folder>

D:\Pro-InstallED\(Optimization)>Taskkill /f /im "Move File = Time Stamp.exe"
ERROR: The process "Move File = Time Stamp.exe" not found.

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Window Control.exe" "The Bat!" "K"
Window Control Program. Build Time: 1/29/2016 11:18:22 PM

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" Taskkill /f /im "Goto Popup Click Botton.exe"
ERROR: The process "Goto Popup Click Botton.exe" not found.

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Popup Click Botton.exe" "Browse For Folder" "OK"
Window Button Click Program. Build time: 1/31/2016 6:03:19 PM
ERROR: Could not find the window.
Usage: WindowButtonClick <Window Name> <Button Name>

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" Taskkill /f /im "Goto Popup Click Botton.exe"
ERROR: The process "Goto Popup Click Botton.exe" not found.

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Popup Click Botton.exe" "Extract Attachments" "&Increment the file name"
Window Button Click Program. Build time: 1/31/2016 6:03:19 PM
ERROR: Could not find the window.
Usage: WindowButtonClick <Window Name> <Button Name>

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" Taskkill /f /im "Goto Popup Click Botton.exe"
ERROR: The process "Goto Popup Click Botton.exe" not found.

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Popup Click Botton.exe" "Extract Attachments" "&OK"
Window Button Click Program. Build time: 1/31/2016 6:03:19 PM
ERROR: Could not find the window.
Usage: WindowButtonClick <Window Name> <Button Name>

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" Taskkill /f /im "Goto Window Control.exe"
ERROR: The process "Goto Window Control.exe" not found.

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\Goto Window Control.exe" "The Bat!" "X"
Window Control Program. Build Time: 1/29/2016 11:18:22 PM

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" Del /f /s /q P:\"Temp\*.xls"
Could Not Find P:\Temp\*.xls

D:\Pro-InstallED\(Optimization)>if not exist "P:\Wait.html" D:\"Pro-InstallED\My = Profit\TheBat Save Message.html = OneShipping.bat.exe"

谢谢帮忙

nttwqz 发表于 2016-10-27 20:40:55

楼主的批处理实在不敢恭维啊,都看不下去。。。

还是把文件名和路径中的空格去掉吧,=去掉最好。

稍微整理下,有问题自己该。



pushd D:\Pro-InstallED\My = Profit\
if not exist "P:\Wait.html" (
        "Move File = Time Stamp.exe" P:\Temp\*.html P:\
        Taskkill /f /im "Move File = Time Stamp.exe"
        "Goto Window Control.exe" "The Bat!" "K"
        Taskkill /f /im "Goto Popup Click Botton.exe"
        "Goto Popup Click Botton.exe" "Browse For Folder" "OK"
        Taskkill /f /im "Goto Popup Click Botton.exe"
        "Goto Popup Click Botton.exe" "Extract Attachments" "&Increment the file name"
        Taskkill /f /im "Goto Popup Click Botton.exe"
        "Goto Popup Click Botton.exe" "Extract Attachments" "&OK"
        Taskkill /f /im "Goto Window Control.exe"
        "Goto Window Control.exe" "The Bat!" "X"
        Del /f /s /q "P:\Temp\*.xls"
        "TheBat Save Message.html = OneShipping.bat.exe"
        Start /min "Invoice To My-Gold.bat" ^& exit
)

if exist "P:\Wait.html" (
        Start /B P:\Temp\Invoice=DONE.xls
        "Goto Window Control.exe" "Microsoft Excel - Invoice=DONE.xls" "L"
)
if not exist "P:\Wait.html" Copy P:\Temp\Message.html P:\Wait.html /Y

clautton 发表于 2016-10-27 23:08:36

nttwqz 发表于 2016-10-27 20:40
楼主的批处理实在不敢恭维啊,都看不下去。。。

还是把文件名和路径中的空格去掉吧,=去掉最好。


谢谢.
不過這一运行就會popup下圖:

nttwqz 发表于 2016-10-27 23:41:29

clautton 发表于 2016-10-27 23:08
谢谢.
不過這一运行就會popup下圖:

加个转义字符试试

clautton 发表于 2016-10-27 23:50:18

本帖最后由 clautton 于 2016-10-28 00:00 编辑

nttwqz 发表于 2016-10-27 23:41
加个转义字符试试

不好意思, 其实我是完全不懂的.
转义字符是什么我也不懂.

clautton 发表于 2016-10-28 18:07:14

nttwqz 发表于 2016-10-27 23:41
加个转义字符试试

我已弄好了. thank you.

clautton 发表于 2016-11-3 20:48:49

clautton 发表于 2016-10-27 23:08
谢谢.
不過這一运行就會popup下圖:

我已去掉所有的空格及=, 改成如下, 但情況一樣, 有时会找不到.exe

pushd D:\Pro-InstallED\(Optimization)\
if not exist "P:\Wait.html" (
      "Move File = Time Stamp.exe" P:\Temp\*.html P:\
      Taskkill /f /im "MoveFileTimeStamp.exe"
      "Goto Window Control.exe" "The Bat!" "K"
      Taskkill /f /im "GotoPopupClickBotton.exe"
      "Goto Popup Click Botton.exe" "Browse For Folder" "OK"
      Taskkill /f /im "GotoPopupClickBotton.exe"
      "Goto Popup Click Botton.exe" "Extract Attachments" "&Increment the file name"
      Taskkill /f /im "GotoPopupClickBotton.exe"
      "GotoPopupClickBotton.exe" "Extract Attachments" "&OK"
      Taskkill /f /im "GotoWindowControl.exe"
      "GotoWindowControl.exe" "The Bat!" "X"
      Del /f /s /q "P:\Temp\*.xls"
      "TheBatSaveMessage.htmlOneShipping.bat.exe"
      Start /min "InvoiceToMy-Gold.bat" ^& exit
)

if exist "P:\Wait.html" (
      Start /B P:\Temp\Invoice=DONE.xls
      "GotoWindowControl.exe" "Microsoft Excel - Invoice=DONE.xls" "L"
)
if not exist "P:\Wait.html" Copy P:\Temp\Message.html P:\Wait.html /Y

EESGT231 发表于 2017-1-11 22:19:02

大多数人想要改造这个世界,但却罕有人想改造自己。http://d2.freep.cn/3tb_170104171811hdqe581472.jpg
页: [1]
查看完整版本: 请教因何有时会找不到文件的?