Hi guys, first post!
I've got a web page with some check boxes the idea being the user selects a check box and then selects a button to launch a script. Ideally I'd prefer it to be a combo box than a checkbox but i've not gotten round to learning combo boxes.
The code is as follows :
<script type="text/VBScript" language="VBScript">
Set WshShell =CreateObject("WScript.Shell")
'
' Marks which script has been selected to run
'
Sub runScript
If b8o.checked Then
runb80
End If
If b8vpn.checked then
runb8vpn
End If
If bdevo.checked then
run bdevo
End If
If bdevvpn.checked then
run bdevvpn
If b70.checked Then
runb70
End If
If b7vpn.checked then
runb7vpn
End If
End Sub
Sub runb80
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" Static 000.000.000.000",0
End Sub
Sub runb8vpn
WshShell.Run "cmd /c netsh interface ip set DNS ""{"" Static 000.000.000.000",0
End Sub
Sub bdevo
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" Static 000.000.000.000",0
End Sub
Sub bdevvpn
WshShell.Run "cmd /c netsh interface ip set DNS ""{"" Static 000.000.000.000",0
End Sub
Sub runb70
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" dhcp",0
End Sub
Sub runb7vpn
WshShell.Run "cmd /c netsh interface ip set DNS ""{"" dhcp",0
End Sub
</Script>
I omitted the IP addresses i am using.
In the body of the page i have the following :
<input type="Checkbox" name="b80"> Banner 8 Office <br><br>
<input type="Checkbox" name="b8vpn"> Banner 8 VPN <br><br>
<input type="Checkbox" name="bdevo"> Business Development Office <br><br>
<input type="Checkbox" name="bdevvpn"> Business Development VPN <br><br>
<input type="Checkbox" name="b70"> Banner 7 Office <br><br>
<input type="Checkbox" name="b7vpn"> Banner 7 VPN <br><br>
<! -- Ok button to run selected script -->
<input type="Submit" value="Run" onclick="runScript">
However when i select the Button it is throwing up errors of Mismatch with the "runScript" part and also i'm getting errors saying b8o object is undefined.
Any help greatly appreciated.
I've got a web page with some check boxes the idea being the user selects a check box and then selects a button to launch a script. Ideally I'd prefer it to be a combo box than a checkbox but i've not gotten round to learning combo boxes.
The code is as follows :
<script type="text/VBScript" language="VBScript">
Set WshShell =CreateObject("WScript.Shell")
'
' Marks which script has been selected to run
'
Sub runScript
If b8o.checked Then
runb80
End If
If b8vpn.checked then
runb8vpn
End If
If bdevo.checked then
run bdevo
End If
If bdevvpn.checked then
run bdevvpn
If b70.checked Then
runb70
End If
If b7vpn.checked then
runb7vpn
End If
End Sub
Sub runb80
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" Static 000.000.000.000",0
End Sub
Sub runb8vpn
WshShell.Run "cmd /c netsh interface ip set DNS ""{"" Static 000.000.000.000",0
End Sub
Sub bdevo
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" Static 000.000.000.000",0
End Sub
Sub bdevvpn
WshShell.Run "cmd /c netsh interface ip set DNS ""{"" Static 000.000.000.000",0
End Sub
Sub runb70
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" dhcp",0
End Sub
Sub runb7vpn
WshShell.Run "cmd /c netsh interface ip set DNS ""{"" dhcp",0
End Sub
</Script>
I omitted the IP addresses i am using.
In the body of the page i have the following :
<input type="Checkbox" name="b80"> Banner 8 Office <br><br>
<input type="Checkbox" name="b8vpn"> Banner 8 VPN <br><br>
<input type="Checkbox" name="bdevo"> Business Development Office <br><br>
<input type="Checkbox" name="bdevvpn"> Business Development VPN <br><br>
<input type="Checkbox" name="b70"> Banner 7 Office <br><br>
<input type="Checkbox" name="b7vpn"> Banner 7 VPN <br><br>
<! -- Ok button to run selected script -->
<input type="Submit" value="Run" onclick="runScript">
However when i select the Button it is throwing up errors of Mismatch with the "runScript" part and also i'm getting errors saying b8o object is undefined.
Any help greatly appreciated.