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
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
