Hi everyone,
I have been lurking here for a while, reading your scripts and trying to see If I can work out why mine doesn't work but I cant seem to make it work correctly.
The command I would like to be able to run from a batch file is this:
for /f %i in ('dir /b /s *.inf') do pnputil.exe -i -a %i
It works perfectly if I open a CMD window and paste the command into the root folder. I cant seem to make it run as a batch file though.
Any help would be wonderful.
Thank you
Rich
Pnputil in batch file
Moderator: DosItHelp
Re: Pnputil in batch file
While FOR variables in a command line have only one percent sign they have two in a batch script. So all you have to do is replacing any occurrence of %i with %%i and you're done
Steffen
Steffen
Re: Pnputil in batch file
I know everyone hates it when people say RTM. But in this case, this usage is clearly defined in the help file.
To use the FOR command in a batch program, specify %%variable instead
of %variable. Variable names are case sensitive, so %i is different
from %I.
Re: Pnputil in batch file
Just as off-topic comment: this problem have no relation to Pnputil program, but to FOR command, so the topic title is entirely confusing...
Antonio
Antonio