Hi
I have following code ...
Dim objFSO, a, s, WshShell, Windir, i, objWMIService, t
strComputer = "."
filespec="C:\anil\perl\server.txt" 'data file with IP addresses
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
s = objFSpentextfile(filespec,1,true).ReadAll
a = Split(s,vbCrLf)
Set WshShell = CreateObject("WScript.Shell")
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
For i=0 to UBound(a)
Err.Clear
If Trim(a(i))<>"" Then
'Launch telnet session from the command line
WshShell.Run "c:\anil\plink.exe " & a(i)
If Err.Number <> 0 Then
wscript.quit
End if
'Wait until the application has loaded
WScript.Sleep 1500
Set ColProcesses = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each Process in ColProcesses
If Process.Name = "plink " & a(i) Then
WshShell.AppActivate Process.Name
End If
Next
WshShell.SendKeys "dsmadm"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
WshShell.SendKeys "exiting4u{ENTER}"
wscript.sleep 600
wscript.sleep 600
WshShell.SendKeys "passwd"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
WshShell.SendKeys "welcome11"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
WshShell.SendKeys "welcome11"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
'WshShell.Sendkeys "exit"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 1000
End If
Next
wscript.quit
it starts plink session but it inputs weired character ..
login as: dsmadm
Using keyboard-interactive authentication.
Password:
Last login: Mon Jan 12 13:22:45 2009 from bwkn08b01089.f2
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
You have mail.
$ pa?ssd
ksh: pa?ssd: not found
$ wel?ome1?
ksh: wel?ome1?: not found
$ welcome11
ksh: welcome11: not found
$
$
Any idea why we getting weired character ?
I have following code ...
Dim objFSO, a, s, WshShell, Windir, i, objWMIService, t
strComputer = "."
filespec="C:\anil\perl\server.txt" 'data file with IP addresses
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
s = objFSpentextfile(filespec,1,true).ReadAll
a = Split(s,vbCrLf)
Set WshShell = CreateObject("WScript.Shell")
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
For i=0 to UBound(a)
Err.Clear
If Trim(a(i))<>"" Then
'Launch telnet session from the command line
WshShell.Run "c:\anil\plink.exe " & a(i)
If Err.Number <> 0 Then
wscript.quit
End if
'Wait until the application has loaded
WScript.Sleep 1500
Set ColProcesses = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each Process in ColProcesses
If Process.Name = "plink " & a(i) Then
WshShell.AppActivate Process.Name
End If
Next
WshShell.SendKeys "dsmadm"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
WshShell.SendKeys "exiting4u{ENTER}"
wscript.sleep 600
wscript.sleep 600
WshShell.SendKeys "passwd"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
WshShell.SendKeys "welcome11"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
WshShell.SendKeys "welcome11"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 600
'WshShell.Sendkeys "exit"
wscript.sleep 600
WshShell.SendKeys "{ENTER}"
wscript.sleep 1000
End If
Next
wscript.quit
it starts plink session but it inputs weired character ..
login as: dsmadm
Using keyboard-interactive authentication.
Password:
Last login: Mon Jan 12 13:22:45 2009 from bwkn08b01089.f2
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
You have mail.
$ pa?ssd
ksh: pa?ssd: not found
$ wel?ome1?
ksh: wel?ome1?: not found
$ welcome11
ksh: welcome11: not found
$
$
Any idea why we getting weired character ?