From: Tcs on 8 Feb 2009 17:42 Thanks guys. I thought that I had checked...sufficiently. Obviously, I was wrong. Seems that the string contains two spaces on the end, following the '22'. Script works properly now. I appreciate the help. Tom On Sun, 08 Feb 2009 20:23:05 +0100, "ekkehard.horner" <ekkehard.horner(a)arcor.de> wrote: >Tcs schrieb: >> I only want the setup.exe to run if the version of the LDISCN32.EXE >> file <> "8.70.8.22". On the machine on which I have been testing >> this, I KNOW the version IS "8.70.8.22". So...it should NOT run. But >> EVERY time I try to run this...it executes the setup.exe. >[...] >To merge urkec's and Al Dunbar's advice: >> For Each objFile in colFiles > > WScript.Echo objFile.Name _ > , objFile.Version _ > , ">" & objFile.Version & "<" _ > , TypeName( objFile.Version ) > >> If objFile.Version <> "8.70.8.22" Then >[...] > >For me, TypeName( objFile.Version ) returns: "String"
From: Al Dunbar on 8 Feb 2009 23:58
"Tcs" <someone(a)somewhere.com> wrote in message news:4qnuo4150628n1qeqb80t8ohbar70kubgl(a)4ax.com... > Thanks guys. You're welcome, > I thought that I had checked...sufficiently. Obviously, I was wrong. > Seems that the string contains two spaces on the end, following the > '22'. Ah, the old "invisible" trailing whitespace - kills you every time. It is always a problem that you will not see this when you display a string variable - unless you bracket it somehow, as in "[" & variable & "]". The "=" and "<>" comparison operators do not include an implicit "close enough is close enough", and generally look for an exact match. > Script works properly now. I appreciate the help. Like most scripts, it always worked - it was just doing something you did not intend! ;-) /Al > Tom > > On Sun, 08 Feb 2009 20:23:05 +0100, "ekkehard.horner" > <ekkehard.horner(a)arcor.de> wrote: > >>Tcs schrieb: >>> I only want the setup.exe to run if the version of the LDISCN32.EXE >>> file <> "8.70.8.22". On the machine on which I have been testing >>> this, I KNOW the version IS "8.70.8.22". So...it should NOT run. But >>> EVERY time I try to run this...it executes the setup.exe. >>[...] >>To merge urkec's and Al Dunbar's advice: >>> For Each objFile in colFiles >> >> WScript.Echo objFile.Name _ >> , objFile.Version _ >> , ">" & objFile.Version & "<" _ >> , TypeName( objFile.Version ) >> >>> If objFile.Version <> "8.70.8.22" Then >>[...] >> >>For me, TypeName( objFile.Version ) returns: "String" |