Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb script to run different batch files

Status
Not open for further replies.

tricity

Technical User
Sep 28, 2012
1
US
I'm looking to build something that will automatically change my IP address and nic speed. We have users that have 7 to 10 different static addresses they need to use and I'm trying to build something that will keep them from manually changing the network settings. I was hoping to create 10 batch files (each batch file is configured with a different static address and network settings) and then have some sort of app I could build that the user could choose a ip from drop down box (option1, option 2, option3, etc). Each option will run a specific bath file. Hope this makes sense.
 
Perhaps an HTA usinjg a modified version of below would work for you

<html>
<head>
<SCRIPT LANGUAGE="VBScript">

sub window_onload

set oSelect = document.createElement("Select")
with oSelect
.size = "1"
.ID = "OptionChooser"
.onChange = GetRef("TestSub")
end with
document.body.appendChild oSelect

For i = 0 to 3
set Opt = document.createElement("Option")
Opt.value = i
if i> 0 then Opt.text = "Option " & i
OptionChooser.Add Opt
next

end sub

Sub TestSub
set objOption = window.event.srcElement
nOptIdx = objOption.selectedIndex
Msgbox objOption(nOptIdx).Text
End Sub

</SCRIPT>
</head>
<Body>

</Body>
</html>





In order to understand recursion, you must first understand recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top