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

link|improve this question

44% accept rate
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
feedback

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. See the FAQ for guidance on how to improve it.

1 Answer

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.

link|improve this answer
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
feedback

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