I am trying to use psexec to run remote DOS commands on a server. Unfortunately I am not permitted to copy the files I am running to the remote machine for security reasons. Therefore I have used the following command...
psexec cmd
This brings up a DOS window and if I type echo %COMPUTERNAME% then the remote machine name is correctly returned. This is fine, but when I type a batch file with the following...
psexec cmd
psexec echo %COMPUTERNAME%
Then the remote machine name is not returned, infact nothing is returned... Due to the fact I cannot remotely move files to the actual server I want to work on then Im assuming performing commands in this way is the only option available. However I cannot seem to execute multiple DOS commands. It is also necessary that I can read the output of the commands I use so that I can perform conditional processing.
If it helps I am able to use VBS scripts to perform these tasks if that provides the correct functionality... Ideally though a pure DOS solution would be great.
Thanks in advance...
Start Free Trial