0

I have some 10 number of batch files those batch files are calling from one main bat file. Now I want to run all those bat file on some remote server.

I used the following command to run my batch file to run on remote server

psexec \\10.47.36.182 -c C:\Users\SVCT\Desktop\samples\_main_script.bat

This is the following output I got while running the above command

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

The system cannot find the file C:\Users\SVCT-WI-Jenkins\Desktop\test.log.
The system cannot find the path specified.
C:\WINDOWS\system32>The system cannot find the path specified.
REM @Echo Off

The system cannot find the path specified. The system cannot find the path specified.

The following is my main batch file.

REM @Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set InputFile=C:\Users\SVCT-WI-Jenkins\Desktop\test.log
For /F "tokens=*" %%I IN (%InputFile%) DO (
Set /a n+=1
Set var!n!=%%I
REM echo "%var!n!%"
)
EndLocal & (
  set "cluster_check=%var1%"
  set "servername=%var2%"
  set "servername1=%var3%"
  set "artifact_folder=%var4%"
)

call C:\Users\SVCT-WI-Jenkins\Desktop\Scripts_palani_new\samples\1_cluster_check.bat %cluster_check%
echo %enviroment%
echo %enviroment%

call C:\Users\SVCT-WI-Jenkins\Desktop\Scripts_palani_new\samples\2_server_connectivity.bat %servername%

Can someone help me to resolve this.. I've to run all my bat files on remote server

2
  • 1
    It's looking for the test.log file in the path you specified on the remote server. Guessing that it's actually a path on your local system and the script should point to something else
    – BrianC
    Jan 3, 2018 at 14:49
  • The file which is existing in my local server not in my remote server how do I correct that. Meanwhile I have to run the inside bat script that also needs to run on the remote server Jan 4, 2018 at 9:38

0

You must log in to answer this question.

Browse other questions tagged .