![]() |
Psexec batch file |
Post Reply
|
| Author | ||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Topic: Psexec batch filePosted: 20 November 2006 at 5:13pm |
|||||
|
Glad to read this. Thanks for your feedback.
Karl |
||||||
![]() |
||||||
kahanlon
Newbie
Joined: 19 November 2006 Online Status: Offline Posts: 2 |
Post Options
Quote Reply
Posted: 19 November 2006 at 8:37pm |
|||||
|
I never thought of calling another batch file, it worked like a charm with the psexec -c option. Thank you |
||||||
![]() |
||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Posted: 19 November 2006 at 4:34am |
|||||
|
Good morning, kahanlon.
Never mind. As no forum search offers a way to search for a multiline text, you had little chance of finding all the sample batches inside the PSTools forum.
It very likely is feasible.
Provided you wish to run only one single command inside cmd.exe you may do it like follows:
Provided you wish to run several commands inside cmd.exe you may do it like follows: Put the commands to be executed in a second batch, named "second.bat" e.g. Then proceed like this:
Note: The psexec option -c has got a different effect than the cmd.exe option /c. There have been reports where calling a batch remotely this way would not work. In such cases, in step 1 the batch had to be copied to \\%SRV% manually beforehand and then called this way in step 2:
For more information on the options of psexec.exe and cmd.exe you may run psexec -? and cmd.exe /?. Hope this helps more than it confuses ,
Karl |
||||||
![]() |
||||||
kahanlon
Newbie
Joined: 19 November 2006 Online Status: Offline Posts: 2 |
Post Options
Quote Reply
Posted: 19 November 2006 at 2:53am |
|||||
|
I am sorry if this has been beat to death, but I did search for this. However I am trying to run a batch file using psexec as one of the commands that goes something like this (not exactly, but it had company information) set srvr=%1 However, after the batch file runs psexec, it will not execute the other commands until after i exit psexec (inside the cmd window), which is not what i want to do. Is what i need to do possible? |
||||||
![]() |
||||||
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |