→ calora:start 123.abc 01/09 20:44
檔名含空白會有問題
假設檔名叫test 123.txt
1. start "test 123.txt"
這樣僅會跳出一個新的 cmd 視窗, 而非開啟test 123.txt
2. start test 123.txt
這樣會跳出一個警告視窗:
"Windows 找不到檔案或項目 'test' ... (後略)"
http://www.dumpt.com/img/viewer.php?file=cohj31fn2y6n1nwml8a3.jpg

→ hpo14:請改用 call 試看看 -> call "test 123.txt" 01/10 19:34
謝謝 改成這樣的確可以解決檔名有空白的問題!
再請教一下 call有辦法像start/b那樣不顯示cmd視窗嗎?(call/?裡面沒寫)
→ hpo14:假若 .abc 關聯程式為 def, 則可以 def "test 123.abc" 試試 01/10 19:44
→ hpo14:但是前提是 def 要可以位在可以被 cmd 自動搜尋的位置 01/10 19:45
→ hpo14:也就是環境變數, 沒有的話可自己新增 01/10 19:46
這個方法不太適用在我的情況, 因為:
1. 手動指定的程式(def)不一定有command line的用法
2. 承上, 就算可以在command line用,
不去翻docs根本就不可能知道parameter要怎麼給@@
(每個parameter代表的意思只有寫該程式的人知道)
而且前提是要有docs
3. 承上, 雙擊該檔案的效果可能是 xxx.exe -p1 a1 -p2 a2 ...
a1 a2 之類的值還有可能早就hard-coded了
不是每個程式都是 xxx.exe argument 這麼簡單
4. 承上, Windows下的副檔名這麼多
不可能手動一個一個寫
光環境變數就設不完了...
(123.abc只是舉例 我希望能套用到所有的副檔名)
※ 編輯: Holocaust123 來自: 140.112.30.32 (01/10 20:48)
--
http://stackoverflow.com/questions/72671/how-to-create-batch-file-in-windows-using-start-with-a-path-and-command-with-sp
縮: http://tinyurl.com/24qen8k
參考這網站的方法 即可用start開啟檔名有空白的檔案:
start "" "test 123.abc"
※ 編輯: Holocaust123 來自: 140.112.30.32 (01/10 21:09)
推 darkgerm:其實start /?就可以查到了 要加上"title"才不會誤判 01/11 00:52
→ hpo14:阿阿,我笨了 XD 忘記先打個 title 就OK 01/11 21:08
→ calora:start "" "123 abc.abc" 01/12 18:30