转贴自香港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 ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容