[轉貼]將ipconfig指令介面化

Home Home
引用 | 編輯 buch
2005-09-16 03:44
樓主
推文 x1
轉貼自香港IT網
對於經常使用ipconfig這個指令的人,
是否覺得老是要在"命令提示字元"下手動輸入是一種麻煩?
以下方法可以將這個程式製作成對話方框,
只要用滑鼠點選就可輕鬆執行你指定的動作喔!
使用方法:用記事本開啟新檔,將以下內容複製上去,另存為*.hta檔後,直接點選就可以執行了

<html>
<head>
<title>The Windows XP IP Configuration Tool </title>

<HTA:APPLICATION
ID = "XApp"
APPLICATIONNAME = "The Windows XP IP Configuration Tool"
BORDER = "thick"
CAPTION = "yes"
ICON = "wxpipc.ico"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE = "normal"
SCROLL = "no"
SCROLLFLAT = "yes"
VERSION = "1.0"
INNERBORDER = "no"
SELECTION = "no"
MAXIMIZEBUTTON = "yes"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "yes"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal">

<OBJECT ID="WindowsShell"
CLASSID="clsid:13709620-C279-11CE-A49E-444553540000">
</Object>

<SCRIPT LANGUAGE="VBScript">

Dim WshShell, FileSystem, CommandLine, ipcswitch, Param
Dim RelAdap, RenAdap, ShoAdap, SetAdap

Set WshShell = CreateObject("WScript.Shell")
Set FileSystem = CreateObject("Scripting.FileSystemObject")

Window.ResizeTo 600, 420
Window.MoveTo 5, 5

Sub ProcessOptions

Set MyForm = Document.dbx
Set RadioButtonDialog = MyForm.Elements("ipcswitch")

For Each RadioButton In RadioButtonDialog
If RadioButton.Checked = True Then
ipcswitch = RadioButton.Value
Exit For
End If
Next


Select Case ipcswitch
Case "/release " Param = MyForm.RelAdap.Value
Case "/renew " Param = MyForm.RenAdap.Value
Case "/showclassid " Param = MyForm.ShoAdap.Value
Case "/setclassid " Param = MyForm.SetAdap.Value
End Select


Call RunCommand

End Sub 'ProcessOptions

Sub RunCommand

CommandLine = "IPConfig " & ipcswitch & Param

Prompter = "This is the IPConfig command that you just configured:" & vbCrlf & vbCrlf &_
"Do you want to execute it?" & vbCrlf & vbCrlf &_
CommandLine

ExecuteIt = MsgBox(Prompter, 1, "The Windows XP IP Configuration Tool")

If ExecuteIt = 1 Then
WshShell.Run "Cmd.exe /t:9F /k " & CommandLine, 1, True
End If

End Sub 'RunCommand

Sub ..

訪客只能看到部份內容,免費 加入會員



獻花 x0
引用 | 編輯 Kilian
2005-09-16 04:47
1樓
  
MS 有個以前出的Win2000 版 ipconfig GUI
Wntipcfg.exe: Windows NT IPConfig Utility
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/wntipcfg-o.asp

可以在 XP 用

獻花 x0
引用 | 編輯 alfa0816
2005-09-17 07:49
2樓
  
好用哩~有了這個就不用每次都在那邊打指令了,謝謝樓主

獻花 x0
引用 | 編輯 mingkevin
2005-09-17 13:51
3樓
  
挺好用的耶@@~還有其他的指令~
可惜我只看得懂/all這個= =a
不過還是感謝分享啊!!

獻花 x0
引用 | 編輯 redazrael
2009-07-28 10:50
4樓
  
好方便,真有創意,謝謝你的分享

獻花 x0
引用 | 編輯 rongyun
2009-09-15 22:12
5樓
  
真是一個好用的工具 不用一直打指令了

獻花 x0
引用 | 編輯 mjchen23
2009-11-01 22:21
6樓
  
好實用喔

謝謝大大分享好用工具啦

感恩

獻花 x0
引用 | 編輯 jackal921
2009-11-20 08:07
7樓
  
thank這樣以後就方便多了

獻花 x0
引用 | 編輯 takashilin
2010-02-19 15:31
8樓
  
好棒 實用又簡單感激不盡

獻花 x0
引用 | 編輯 diostar
2010-09-14 08:25
9樓
  
thanks for sharing

獻花 x0
引用 | 編輯 freeze02468
2013-12-30 15:13
10樓
  
真的是很感謝大大能夠提供那麼實用的教學!

小弟上了寶貴的一課!

謝謝大大的分享~ 表情

獻花 x0
引用 | 編輯 freeze02468
2013-12-31 01:35
11樓
  
真的很感謝大大能提供這麼實用的教學!

小弟上到了寶貴的一課! 真的是受益良多阿! 表情

獻花 x0
引用 | 編輯 boss206
2014-05-10 00:10
12樓
  
不經一事不長一智.學習了~~~

獻花 x0
引用 | 編輯 dorbytan
2017-06-01 00:13
13樓
  
打指令是有成就感,可是圖形化真的是方便也是視窗系統的精神,感謝大大分享,端節愉快。

獻花 x0