I have a batch script that doesnt seem to be placing specific information inside a varible. Here is what I am having issues with:
FOR /f "tokens=*" %%f IN ('DIR /B %~dp0%%y\%%m\*.*') DO (
WUSA %~dp0%%y\%%m\%%f /quiet /norestart /log:%~dp0%LOGFILE%
We have a files in the specific %~dp0%%y\%%m directory that lists .exe and .msi files. We want the name of the file placed into %%f so we can then run it, however everytime I run the batch file it states that it "cannot find the path specified".
I verified that the %~dp0%%y\%%m is the correct directory and that the DIR /B %~dp0%%y\%%m\*.* seems to list the file names correctly but for some reason it will not feed into %%f ....
I have tried putting Echo %%f after the DO to see if anything was being placed inside but it does not list anything.
Is there any ideas on how to fix this or what is going wrong? Essentially we want it to run in a loop and install each .exe in the file one after the other.