![]() |
PSEXEC @list |
Post Reply
|
| Author | ||
cooolvick
Newbie
Joined: 28 November 2007 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: PSEXEC @listPosted: 28 November 2007 at 1:04pm |
|
|
Hi all,
I would like to use PSEXEC to find the actual machine name for a list of computers Not sure which variable I have to compare against %computername% Main command : PSEXEC @list.txt test.bat Test.bat : Set Name = %computername% IF "%name%" == ?????? Appreciate the help |
||
![]() |
||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Status: Offline Points: 5131 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 November 2007 at 3:12pm |
|
|
Hello, cooolvick.
Could you be bothered to elaborate a bit more clearly what you wish to achieve?
(1) Avoid spaces unless required, i.e.
(2) In the IF statement, with which value do you wish to compare %NAME%? Which other variable? Which hardcoded string? (3) How is this related to using the "@list" in any way? Kind regards, Karl |
||
![]() |
||
cooolvick
Newbie
Joined: 28 November 2007 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 November 2007 at 5:21pm |
|
|
Could you be bothered to elaborate a bit more clearly what you wish to achieve?
Objective -Using a list of computers, connect to all machines via @list and check the hostname at the machine itself. execute some commands if the name matches else exit out. Set Name = %computername% This assigns the computername of the remote machine where test.bat is run to the variable "name". (1) Avoid spaces unless required, i.e. Set Name=%computername% A) Point taken. (2) In the IF statement, with which value do you wish to compare %NAME%? Which other variable? Which hardcoded string? a) The actual question is what should I use to compare %name% with because PSEXEC executes the batch file locally on the machine does not pass the machine name from "list" (3) How is this related to using the "@list" in any way? I wanted to do this on set of machines and thats why I am using @list Thanks for looking at it |
||
![]() |
||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Status: Offline Points: 5131 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 November 2007 at 12:58am |
|
|
Hi, cooolvick.
I hope I understand you correctly now:
HTH, Karl Edited by Karlchen - 29 November 2007 at 1:00am |
||
![]() |
||
cooolvick
Newbie
Joined: 28 November 2007 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 November 2007 at 11:51am |
|
|
Thanks a lot..it worked like a charm
|
||
![]() |
||
Post Reply
|
|
|
Tweet
|
| 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 |