2016-11-18 73 views
0

爲什麼不能用類似於記事本的默認文件運行我的應用程序? 下面AutoIt的示例代碼:爲什麼我不能像記事本那樣使用默認文件運行我的應用程序?

Example() 

Func Example() 
     ; Run Notepad 
     Run("Notepad.exe " & "C:\Users\judith_francis\Desktop\dd.txt") 

     Run("C:\Program Files (x86)\abc\abc.exe" & "C:\Users\xyz\Desktop\test_image.tif") 

EndFunc 
+0

什麼是你的實際問題來執行? – Ouroborus

+0

我無法運行此行運行(「C:\ Program Files(x86)\ abc \ abc.exe」&「C:\ Users \ xyz \ Desktop \ test_image.tif」) – Nisha

回答

2

這條線:

Run("C:\Program Files (x86)\abc\abc.exe" & "C:\Users\xyz\Desktop\test_image.tif") 

運行命令

C:\Program Files (x86)\abc\abc.exeC:\Users\xyz\Desktop\test_image.tif 

哪種版本的Windows將其解釋爲

C:\Program 

嘗試代替

Run('"C:\Program Files (x86)\abc\abc.exe" ' & '"C:\Users\xyz\Desktop\test_image.tif"') 

這增加&報價&必要的空間將作爲

"C:\Program Files (x86)\abc\abc.exe" "C:\Users\xyz\Desktop\test_image.tif" 
相關問題