1

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

Eddy
  • 257
  • 3
  • 10
  • 22
  • 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 04:51

1 Answers1

4

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.

Dan
  • 15,430
  • 1
  • 36
  • 67
  • 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