发新话题
打印

[转载]ipconfig工具图形界面脚本

[转载]ipconfig工具图形界面脚本

信息来源:www.juntuan.net

使用方法:保存为*.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 &#39;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 &#39;RunCommand

Sub DisplayHelp

HelpCommand = "ipconfig /?"
WshShell.Run "Cmd.exe /t:9F /k " & HelpCommand, 1, True

End Sub &#39;DisplayHelp

Sub CloseDown

  Window.Close
  Wscript.Quit
  
End Sub &#39;CloseDown  

</Script>
</head>

<body bgcolor="#E0E2EB">

<form name="dbx">

<div align="left">

<table border="0" cellspacing="1" width="600">


   <tr>
      <td valign="top">
      <fieldset><legend>IPConfig Switches</legend>
      <div align="left">
      <table border="0" cellspacing="1" width="675">
        <tr>
           <td width="50%">
              <p><input type="radio" name="ipcswitch" value="">Display basic TCP/IP configuration</p>
           </td>
           <td width="50%">
                        
           </td>
        </tr>
        <tr>
           <td width="60%">
              <p><input type="radio" name="ipcswitch" value="/all">Display full TCP/IP configuration (/all)</p>           
           </td>
           <td width="40%">
                        
           </td>
        </tr>
        <tr>
           <td width="50%">
              <p><input type="radio" name="ipcswitch" value="/release ">Release current DHCP configuration (/release)</p>           
           </td>
           <td width="50%">
              <p><input type="text" size="16" name="RelAdap"></p>           
           </td>
        </tr>
        <tr>
      <td width="50%">
         <p><input type="radio" name="ipcswitch" value="/renew ">Renew DHCP configuration (/renew)</p>           
      </td>
      <td width="50%">
         <p><input type="text" size="16" name="RenAdap"></p>           
      </td>
        </tr>
        <tr>
      <td width="50%">
         <p><input type="radio" name="ipcswitch" value="/displaydns">Display the DNS client resolver cache (/displaydns)</p>           
      </td>
      <td width="50%">
                    
      </td>
        </tr>
        <tr>
      <td width="50%">
         <p><input type="radio" name="ipcswitch" value="/flushdns">Flush and reset the DNS client resolver cache (/flushdns)</p>           
      </td>
      <td width="50%">
                    
      </td>
        </tr>
        <tr>
      <td width="50%">
         <p><input type="radio" name="ipcswitch" value="/registerdns">Refresh DHCP lease and re-register DNS names (/registerdns)</p>           
      </td>
      <td width="50%">
                    
      </td>
        </tr>
        <tr>
      <td width="50%">
         <p><input type="radio" name="ipcswitch" value="/showclassid ">Display the DHCP class ID (/showclassid)</p>           
      </td>
      <td width="50%">
         <p><input type="text" size="16" name="ShoAdap"></p>           
      </td>
        </tr>
        <tr>
      <td width="50%">
         <p><input type="radio" name="ipcswitch" value="/setclassid ">Configure the DHCP class ID (/setclassid)</p>           
      </td>
      <td width="50%">
         <p><input type="text" size="16" name="SetAdap"></p>           
      </td>
        </tr>
        <tr>
        <td> </td>
   </tr>
        
      </table>
      </div>
      </fieldset>
      </td>
   </tr>
   <tr>
     <td> </td>
   </tr>

      
</table>
</div>
</form>

<table border="0" cellspacing="1" width="100%">
   <tr>
      <td valign="top"><font color="#0000FF" size="1">
      Created For TechRepublic <br>
      by Greg Shultz<br>
      <a href="[url]http://www.TheWinWiz.com[/url]" target="_blank">[url]www.TheWinWiz.com</a>[/url]
      </td>
      <td align="right" valign="top">
      <input type="button" value="  Help  " onclick="DisplayHelp">
      <input type="button" value="   OK   " onclick="ProcessOptions">
      <input type="button" value="Close" onclick="CloseDown">
      </td>
   </tr>
</table>


</body>
</html>
qq310926是我唯一用号,除此之外有其他号码号自称邪八冰血封情,则非本人。

TOP

发新话题