LinuxデバイスにTelnetで接続するVBScriptがあり、使用可能なメモリを確認したいと思います。次のコマンドは、「無効なプロシージャ呼び出しまたは引数」エラーを生成します。
WshShell.SendKeys"df /mnt/cf | awk '/mnt/{print$2}'"
これは、デバイスに手動でtelnetで接続し、同じコマンドを使用した場合に機能します。何かアドバイス?
これまでのコード:
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.run"cmd"
'*** open command window ***
WScript.Sleep 250 WshShell.SendKeys("{Enter}")
WshShell.SendKeys"telnet 10.13.2.2 -f VBSmemSize.txt"
WshShell.SendKeys("{Enter}")
WScript.Sleep 2000
WshShell.SendKeys"root"
WshShell.SendKeys("{Enter}")
WScript.Sleep 1500
WshShell.SendKeys"password"
WshShell.SendKeys("{Enter}")
WScript.Sleep 1500
WshShell.SendKeys"df /mnt/cf |awk '/mnt/{print$2}'"
WshShell.SendKeys("{Enter}")