Solved Batch parsing through a folder

April 29, 2013 at 05:17:47
Specs: Windows 7, Core2duo 2ghz / 4G
Hi,

I've got a little batch that picks up flash player installation files in a folder and installs them. It seems to be working, but it throws an MSI error at the end. Here's the batch:

For %%G IN (dir *flash_player* /b) do msiexec /a %%G /passive

And here's the CMD output:

C:\PCTools\enhancements\system>For %G IN (dir *flash_player* /b) do msiexec /a %
G /passive

C:\PCTools\enhancements\system>msiexec /a dir /passive

C:\PCTools\enhancements\system>msiexec /a flash_player-ie.msi /passive

C:\PCTools\enhancements\system>msiexec /a flash_player-plugins.msi /passive

C:\PCTools\enhancements\system>msiexec /a /b /passive

The first and second lines produce nothing. The third and fourth lines manifest the flish player installers. The MSI error popup occurs at the last line. It seems to be parsing the batch command as its own file, which of course doesn't exist.


See More: Batch parsing through a folder

Report •


✔ Best Answer
April 30, 2013 at 16:44:45
Thanks much, guys. I came up with the following, which seems to work perfectly:

For /f "tokens=*" %%G in ('dir  /b "*flash_player*"') do msiexec /a %%G /passive

This will come in handy in many situations.

Be well.



#1
April 29, 2013 at 05:39:46
for /f "tokens=* delims= " %%a in ('dir/b blabla') do (

)

=====================
M2 Golden-Triangle


Report •

#2
April 30, 2013 at 09:03:41
Thanks, I have to see how to implement that.

Report •

#3
April 30, 2013 at 15:40:54
Alternatively:
For %%G IN (*flash_player*) do msiexec /a %%G /passive

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
April 30, 2013 at 16:44:45
✔ Best Answer
Thanks much, guys. I came up with the following, which seems to work perfectly:

For /f "tokens=*" %%G in ('dir  /b "*flash_player*"') do msiexec /a %%G /passive

This will come in handy in many situations.

Be well.


Report •


Ask Question