[windows2000] String Comparison in CMD or BAT script?

  • From: "Robert K Coffman Jr - Info From Data Corporation" <bcoffman@xxxxxxxxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Tue, 30 Dec 2003 09:22:25 -0500

Anyone have an elegant solution to this?

I have a series of servers, all beginning with the same 4 letter string.
I'd like to check for the first 4 letters, rather than the entire string.
In other words, how can I do a LEFT$ in a script?

current solution that blows:

if '%computername%' == 'TCCA01' goto skip_notice
if '%computername%' == 'TCCA02' goto skip_notice

Thanks for any assistance.

- Bob Coffman

Other related posts: