![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-23 12:21 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Want to use a bat script to automatically enter the password to remotely copy Linux files |
| Printable Version 5,368 / 0 |
| Floor1 gwh513652660 | Posted 2020-01-02 16:01 |
| 新手上路 Posts 2 Credits 3 | |
|
The batch script wants to implement copying files corresponding to a certain time point from a Linux server by entering a specific time point. Script 1 can enter the corresponding time point, but it has to enter the password for logging in to the Linux server every time. Trying to call a VBS script to automatically enter the password doesn't work. Script 2 can realize the input of the password but can't manually enter the time point. Seek guidance from great gods on how to achieve it.
Script 1: @echo off echo Copying tfr waveforms.... 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 Copying completed pause Script 2: @echo off echo Copying tfr waveforms.... 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 |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |