Execute bat file that launches psexec using MATLAB

조회 수: 3 (최근 30일)
Christoforos Zoumas
Christoforos Zoumas 2019년 11월 1일
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개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by