Is there a way I can have a single batch to run different configuration according to the Computer name ?

closed as not a real question by joeqwerty, Tom O'Connor, Scott Pack, Chris S, mailq Nov 22 '11 at 19:13

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Like Dan said yes. I'm not sure you end goal or the scope of this is, but if you have a medium to large environment, it might be better to break yyour computers up into different Orginisational Units in Active directory and apply different scripts to the OUs. – Nixphoe Nov 22 '11 at 14:59
  • Too bad someone converted this to "not a question" because I know the answer. – djangofan Jan 22 '13 at 4:51

Yes, batch files support IF statements, and you can use any of the system variables (Type "set" at the command prompt to get an idea). Combine that with "labels" and you can easily create a decent script.

I'm going to deliberately not Google that for you, though.

Personally, I'd set a custom Environmental Variable defining what 'type' of machine it is in reference to whatever it is you're doing.

  • thanks for your reply dan, what i need to do is to set a different Id for a custom application and it can be done using a batch but i need to do it for more that 1200 machine the ID is different for each machine how can i do it as you suggested with IF computername = ? – Eddy Nov 22 '11 at 16:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.