سؤال

i need to update iTunes in 800+ computers.

The version number is deployed thru a txt file:

I am trying to start a logon script where i query if itunes is updated, i am not used with wmic commands so i need something like:

if version is 11.1.1.11 (version.txt) goto end, else start itunesupdate.bat

This is the command to get the installed iTunes version

wmic product where name="iTunes" get name, version

Now i need something to query a txt file where the actual version number is

If version is diferent, then run the command:

\10.x.xxx.xxx\hgw\sc\itunes_update.bat

هل كانت مفيدة؟

المحلول

You can use the FOR command with the /F argument to read a file line by line and have that line tokenized in environment variables.

FOR /F %i IN (version.txt) DO if NOT %i==11.1.1.11 itunesupdate.bat
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top