2010-10-10 64 views
0
– ping www.google.com –t 

我已經在桌面上創建了一個快捷方式,並鍵入此命令,因爲它的「目標」..現在,當我雙擊它時,cmd窗口打開秒並消失。 。如何讓它在後臺運行直到此過程被手動結束?快捷方式名稱爲「Ping」,並且在任務管理器中沒有看到名爲「Ping」的進程。我要的是保持對谷歌執行ping服務器我如何讓這個命令在後臺運行

+0

感謝這兩個回答...我找到了解決辦法在這裏... HTTP://www.winhelponline.com/blog/run-bat-files -invisibly-without-displays-command-prompt/ – Serenity 2010-10-11 03:09:57

回答

3

解決方案1: 請在命令提示符下手動平,寫在這使它成爲一個持久的平末端的-t。你將不得不關閉cmd提示窗口來停止ping。

在命令提示符下例如,鍵入:ping www.google.com -t

解決方案2: 你可以創建像這樣

cmd /c "ping www.google.com –t" 

解決方案的快捷方式3: 任何免費Ping實用程序會做什麼,你要求,谷歌檢查「免費ping」,這也將 工作。

PK

+0

確定手動運行命令..它正在ping,但味精像「Request Timed out」之間..這是什麼意思? – Serenity 2010-10-10 13:25:09

+0

另外,當我創建這樣的快捷方式就像你說的..它dsplayed cmd窗口秒說「不良參數-t」這是什麼目標值是System32 \ cmd.exe/c「ping www.google.com -t」是這是正確的? – Serenity 2010-10-10 13:30:26

+0

Ping請求超時... \t找到地址,但它沒有響應ping請求。你的系統沒有問題。所以別擔心。 – Pavan 2010-10-10 13:46:11

2

設定的目標爲:%windir%

[編輯]

來隱藏cmd窗口

 using System.Runtime.InteropServices; 


     [DllImport("user32.dll")] 
     static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 
     [DllImport("user32.dll")] 
     static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); 

:在%windir%\system32\ping.exe www.google.com -t

和開始在主

 IntPtr hWnd = FindWindow(null, "ping"); 
     if (hWnd != IntPtr.Zero) 
     { 
      ShowWindow(hWnd, 0); 
     } 

取消隱藏

ShowWindow(hWnd, 1); 
+0

好的,我現在怎麼讓它在後臺運行呢? – Serenity 2010-10-10 13:34:03

+0

我可以推薦你使用c#程序嗎? – Barun 2010-10-10 13:51:58

+0

肯定..會佔用更少的內存空間嗎? – Serenity 2010-10-10 13:55:48