Re: [問題] 如何把cmd執行內容轉成.cmd檔?消失

看板ask作者時間10年前 (2014/02/16 20:22), 編輯推噓1(1019)
留言20則, 7人參與, 最新討論串1/2 (看更多)
不好意思 又有問題了! 我把BAT改成下面這樣 存成BAT還是不行耶 我已經先把bb.apk安裝了 但是執行BAT後還是沒有成功移除APP耶... cd C:\Program Files\adt-bundle-windows-x86-20130917\sdk\platform-tools adb kill-server adb start-server adb uninstall com.vida 謝謝! 有看到顯示: 'adb' 不是內部或外部命令、 可執行的程式或批次檔。 ※ 引述《HCCH (HCCH)》之銘言: : ※ [本文轉錄自 Windows 看板 #1J08SElB ] : 作者: HCCH (HCCH) 看板: Windows : 標題: [問題] 如何把cmd執行內容轉成.cmd檔? : 時間: Sun Feb 16 17:38:20 2014 : 想請問各位高手 : 我想把下面的cmd執行過程轉成執行檔cmd 或 bat都可以 : 不知道該怎麼做? : 謝謝! : Microsoft Windows XP [版本 5.1.2600] : (C) Copyright 1985-2001 Microsoft Corp. : C:\Documents and Settings\ME>cd C:\adt-bundle-windows-x86-20130917\sdk\platfo : rm-tools : C:\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb kill-server : * server not running * : C:\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb start-server : * daemon not running. starting it now on port 5037 * : * daemon started successfully * : C:\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb install bb.apk : 127 KB/s (5298644 bytes in 40.468s) : pkg: /data/local/tmp/bb.apk : Success : C:\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb uninstall com.vida : Success -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.73.225.212 ※ 編輯: HCCH 來自: 203.73.225.212 (02/16 20:33)

02/16 20:46, , 1F
你原先沒有 \Program Files,再檢查一下是不是這個原因
02/16 20:46, 1F

02/16 20:51, , 2F
你列的路徑底下有adb.exe這個檔案嗎?
02/16 20:51, 2F
回1.2F 路徑確定沒錯 也有adb.exe 我剛剛用cmd 執行成功 但是相同內容的BAT檔卻沒反應... Microsoft Windows XP [版本 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Houcc>cd C:\Program Files\adt-bundle-windows-x86-20130 917\sdk\platform-tools C:\Program Files\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb kill-ser ver C:\Program Files\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb start-se rver * daemon not running. starting it now on port 5037 * * daemon started successfully * C:\Program Files\adt-bundle-windows-x86-20130917\sdk\platform-tools>adb uninstal l com.vida Success 不知道是哪邊問題... ※ 編輯: HCCH 來自: 203.73.225.212 (02/16 21:14)

02/16 21:17, , 3F
要加""
02/16 21:17, 3F

02/16 21:25, , 4F
請問樓上 ""是要加在哪邊呢? 謝謝
02/16 21:25, 4F
我把BAT內容改成下面這樣 還是不行.. "cd C:\Program Files\adt-bundle-windows-x86-20130917\sdk\platform-tools" "adb kill-server" "adb start-server" "adb uninstall com.vida" ※ 編輯: HCCH 來自: 203.73.225.212 (02/16 21:31)

02/16 21:34, , 5F
cd後面那一長串才要加
02/16 21:34, 5F
改成這樣也一樣耶0.0 cd "C:\Program Files\adt-bundle-windows-x86-20130917\sdk\platform-tools" adb kill-server adb start-server adb uninstall com.vida ※ 編輯: HCCH 來自: 203.73.225.212 (02/16 21:37)

02/16 21:38, , 6F
02/16 21:38, 6F

02/16 21:38, , 7F
等等 我修正一下檔案 先不要下載
02/16 21:38, 7F

02/16 21:41, , 8F
我以為我寫錯了 你下載後按編輯 和你自己寫的比對一下
02/16 21:41, 8F

02/16 21:43, , 9F
好的 謝謝ra大︿︿
02/16 21:43, 9F

02/16 21:43, , 10F
就知道問題出在哪 另外初學寫批次檔的話 建議在最後加上
02/16 21:43, 10F

02/16 21:43, , 11F
pause 如此有錯誤的話才會出現在畫面上
02/16 21:43, 11F

02/16 21:47, , 12F
我發現原來bat要放在platform-tools下才會執行 不然就是loop
02/16 21:47, 12F

02/16 21:47, , 13F
終於成功了 謝謝大家 也謝謝ra大︿︿
02/16 21:47, 13F

02/16 21:48, , 14F
正常來說 批次檔放在哪裡都能正常執行
02/16 21:48, 14F

02/16 21:49, , 15F
對阿 我之前也是這樣 不知這次怎要放在platform-tools下才行.
02/16 21:49, 15F

02/16 21:52, , 16F
因為沒設環境變數吧,所以才能在特定資料夾下執行@@?
02/16 21:52, 16F

02/16 21:53, , 17F
你的批次檔是不是沒放在C槽裡?
02/16 21:53, 17F

02/16 21:59, , 18F
我原本是在D槽執行 失敗 放到C槽才行...
02/16 21:59, 18F

02/16 22:15, , 19F
cd /d "C:\ 第一行改成這樣開頭
02/16 22:15, 19F

02/16 22:30, , 20F
謝謝r大 這樣就可以在D槽執行了︿︿ 謝謝
02/16 22:30, 20F
文章代碼(AID): #1J0AsVcd (ask)
文章代碼(AID): #1J0AsVcd (ask)