Multi-Gaming Community
It is currently 17 Jun 2025, 10:37

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: vbs scripting
PostPosted: 22 Nov 2010, 15:42 
Offline
Community slut (13474)
User avatar
Anyone here with decent knowledge on vbs scripting? If you, could you explain me a thing or 2 in a private confo?


Top
   
 Post subject: Re: vbs scripting
PostPosted: 22 Nov 2010, 16:46 
Offline
Has learned to write! (217)
You talking about vbscript? As is document.write("this stuff");

_________________
Don't worry I got some silicon carrots - [SpA]Bucky O'Hare


Top
   
 Post subject: Re: vbs scripting
PostPosted: 22 Nov 2010, 17:24 
Offline
Community slut (13474)
User avatar
Its this:
Quote:
# $language = "VBScript"
# $interface = "1.0"

' script version = 0.3


' set delay timer
g_nDelay = 1000

Sub Main
Dim host
host = crt.Dialog.Prompt("Enter IP address", "IP", "", False)
Dim user
user = "xxxx"
Dim passwd
passwd = "xxxx"

Dim interface
interface = crt.Dialog.Prompt("Enter interface", "Interface", "", False)
' Build a command-line string to pass to the Connect method.
'
cmd = "/SSH2 /L " & user & " /PASSWORD " & passwd & " /C 3DES /M MD5 " & host

crt.Session.Connect cmd

crt.Screen.WaitForString "Press any key to continue"
crt.screen.Send Chr(10)
crt.Screen.Send "conf t" & vbCr
crt.Screen.WaitForString "(config)#"
crt.Screen.Send "no aaa port-access mac-based " & interface & vbCr
crt.Screen.WaitForString "(config)#"
crt.Screen.Send "interface " & interface & vbCr
crt.Screen.WaitForString "(eth-"
crt.Screen.Send "disable" & vbCr
crt.Screen.WaitForString "(eth-"
crt.Sleep g_nDelay
crt.Screen.Send "enable" & vbCr
crt.Screen.WaitForString "(eth-"
crt.Screen.Send "exit" & vbCr
crt.Screen.WaitForString "(config)#"
crt.Screen.Send "aaa port-access mac-based " & interface & vbCr
crt.Screen.WaitForString "(config)#"
crt.Screen.Send "exit" & vbCr
crt.Screen.WaitForString "#"
crt.Screen.Send "sh port-access mac-based " & interface & vbCr
crt.Screen.WaitForString "#"
crt.Screen.Send "repeat" & vbCr
crt.Screen.WaitForString "1 0"
crt.Screen.Send Chr(10)
crt.Screen.Send "sh mac " & interface
End Sub
I made this today to semi-automate a reset cycle we need to perform due to some software bug. Pretty much what i want to do is replace the IP promt for a list with dropdown options but i can't find any example code to steal from.


Top
   
 Post subject: Re: vbs scripting
PostPosted: 25 Dec 2010, 05:05 
I know Visual Basic

and if you mean .bat file VBScript i may be able to help.


Top
   
 Post subject: Re: vbs scripting
PostPosted: 25 Dec 2010, 10:53 
Offline
Has no REAL life! (1120)
Planitia wrote:
I know Visual Basic

and if you mean .bat file VBScript i may be able to help.
Judging by the date of the topic, he probably has this fixed by now. :ugly:

And I'm fairly sure it doesn't come with any controls bar the confirmation and message box (wrap something around it?)

_________________
slurper


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+02:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited