WindowsXP-SP1/admin/cys/test/test-setstaticipaddressandsubnetmask.vbt
2020-09-30 16:53:49 +02:00

56 lines
1.3 KiB
Plaintext

'
' Test IConfigureYourServer::SetStaticIpAddressAndSubnetMask
'
option explicit
// this is a Visual Basic Script "Template", used in conjunction with the
// MS Visual C++ Preprocessor to overcome some of the source management
// limitations of VBScript. Not perfect, but better than a stick in the eye.
//
// use cl /EP foo.vbt > foo.vbs to expand the template
const SCRIPT_FILENAME = "test-SetStaticIpAddressAndSubnetMask.vbs"
const SCRIPT_SOURCE_NAME = __FILE__
const SCRIPT_DATE = __DATE__
const SCRIPT_TIME = __TIME__
// this is all our common code.
#include "common.vbi"
Main
wscript.quit(0)
sub Main
On Error Resume Next
if wscript.arguments.count <> 2 then
Echo "supply an IP address and subnet mask"
Exit sub
end if
Echo "addr = " & wscript.arguments.item(0)
Echo "mask = " & wscript.arguments.item(1)
Dim srvwiz
Set srvwiz = CreateObject("ServerAdmin.ConfigureYourServer")
dim i
i = srvwiz.SetStaticIpAddressAndSubnetMask(wscript.arguments.item(0), wscript.arguments.item(1))
if Err.Number then DumpErrAndQuit
echo i
if i Then
Echo "IP configuration succeeded"
else
Echo "IP configuration failed"
end if
End sub