bat脚本想实现输入某个时间点,从linux服务器上拷贝对应时间的文件。
采用脚本1能输入对应时间点,但是每次都要输入liunx服务器登陆的密码,想调用vbs脚本实现密码的自动输入发现不行。脚本2可以实现密码的输入但是无法手动输入时间点。
求大神指点如何才能实现。
脚本1:- @echo off
- echo 拷贝tfr波形....
- set /P WAVETIME=WAVETIME:
- d:
- mkdir VBC_TFR
- scp root@198.120.0.117:/wave/*%WAVETIME%*.* d:\VBC_TFR
- start cscript //nologo Del_Setting.vbs
- echo 拷贝完成
- pause
复制代码 脚本2:- @echo off
- echo 拷贝tfr波形....
- echo set sh=WScript.CreateObject("WScript.Shell")>Del_Setting.vbs
- echo WScript.Sleep 500 >>Del_Setting.vbs
- echo sh.Sendkeys "scp root@198.120.0.117:/wave/*%WAVETIME%*.* d:\VBC_TFR{ENTER}">>Del_Setting.vbs
- echo WScript.Sleep 500 >>Del_Setting.vbs
- echo sh.Sendkeys "Nroot-9700{ENTER}">>Del_Setting.vbs
- start set /P WAVETIME=WAVETIME: /
- cscript //nologo Del_Setting.vbs
复制代码
|