MATLAB Answers

Execute bat file that launches psexec using MATLAB

Christoforos Zoumas 님이 질문을 제출함. 1 Nov 2019
Dear all,
I have installed PsExec https://docs.microsoft.com/en-us/sysinternals/downloads/psexec in my pc in the path C:\PSTools
I have created the bat file 'Test.bat' that opens the cmd in the remote IP XXX.XXX.XXX.XX.
The context of the 'Test.bat' is the following:
C:\PSTools\psexec \\XXX.XXX.XXX.XX cmd.exe
When i run the bat file manually using windows cmd, it is successfully executed and i get the following result in windows cmd
% PsExec v2.2 - Execute processes remotely
% Copyright (C) 2001-2016 Mark Russinovich
% Sysinternals - www.sysinternals.com
%
%
% Microsoft Windows [Version 6.3.9600]
% (c) 2013 Microsoft Corporation. All rights reserved.
When i try to run the batch file with MATLAB using the command
system('Test.bat')
the command is not executed successfully and I get the following result in matlab command window:
%
% PsExec v2.2 - Execute processes remotely
% Copyright (C) 2001-2016 Mark Russinovich
% Sysinternals - www.sysinternals.com
%
% Microsoft Windows [Version 6.3.9600]Connecting to XXX.XXX.XXX.XX...
%
%
% Starting PSEXESVC service on XXX.XXX.XXX.XX...
%
%
% Connecting with PsExec service on XXX.XXX.XXX.XX...
%
%
% Starting cmd.exe on XXX.XXX.XXX.XX...
%
%
% cmd.exe exited on XXX.XXX.XXX.XX with error code 0.
%
% ans =
%
% 0
Could you please help me with that?
Thanks a lot

  댓글 수: 0

로그인 to comment.

답변 수: 0


Translated by