To run a perl file placed in linux machine from batch file use "plink" utility of PuTTY in batch scripting.
As shown below write batch script and as on execution of batch file in windows machine, the perl will be triggered in linux machine.
PuTTY should be installed in the windows(source machine) and plink.exe should be there in the installation folder and it does the job of running perl file in linux machine.
perlexecutioninlinux.bat
@echo off set "destinationUser=linuxadmin" set "destinationPassword=MyPassword#123" set "destinationHost=11.123.4.567" set "scriptPath=/home/linuxadmin/AutomationProject/my-perl-file.pl" plink -pw %destinationPassword% -batch %destinationUser%@%destinationHost% "perl %scriptPath%" timeout /t 5 /nobreak exit
No comments:
Post a Comment