Ola Jocivan,
Bom vc pode usar um Inputbox, onde ele obtem a informação do usuário seja clicando sobre o script ou usando a console com cscript..
Set WshShell = WScript.CreateObject("WScript.Shell")
ip = UserInput("Digite o ip:","Titulo da Janela")
if ip = "" then wscript.quit
WshShell.Run "telnet " & ip,9
WScript.Sleep 500
WshShell.SendKeys "userc"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "password"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "cd /var/log"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "tail -f trace.txt"
WshShell.SendKeys "{ENTER}"
Function UserInput(sPergunta,sTitulo)
If UCase( Right( WScript.FullName, 12 ) ) = "\CSCRIPT.EXE" Then
WScript.StdOut.Write sPergunta & " "
UserInput = WScript.StdIn.ReadLine
Else
UserInput = InputBox(sPergunta,sTitulo)
End If
End Function
ou você pode usar uma bat e um vbscript como vc perguntou, a bat passando o comando para o vbs
BAT
@ECHO OFF
set /p ip=Informe o IP:
cscript Script.vbs %ip%
SCRIPT.VBS
set args = WScript.Arguments
select case args.Count
case 0
wscript.echo "Error: Necessário passar o argumento , Ex: ""cscript MyScript.vbs arg"""
wscript.quit
case 1
ip = args(0)
wscript.echo ip
end select
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "telnet " & ip,9
WScript.Sleep 500
WshShell.SendKeys "userc"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "password"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "cd /var/log"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "tail -f trace.txt"
WshShell.SendKeys "{ENTER}"
att, Aparecido Deveza