All,
I want to make a batch file which looks into a certain directory for *.txt files. In these *.txt files a computer hostname is mentioned, which should be read as a variable for a command.
So far I have got this:
FOR /F %%i IN (c:\txt\test.txt) DO psexec %%i -c c:\reg.bat
This works, but only for the "test.txt" file. I want to make it work for ALL txt files in the specified directory. When I replace (c:\txt\test.txt) with (c:\txt\*.txt) it doesn't work. It says that it cannot find "*.txt" (thinking *.txt is the file name).
I tried utilities like FORTUNE and FORALL but I don't really understand how to get it working in this case.
Can anyone help me?
Thnx in advance...
I want to make a batch file which looks into a certain directory for *.txt files. In these *.txt files a computer hostname is mentioned, which should be read as a variable for a command.
So far I have got this:
FOR /F %%i IN (c:\txt\test.txt) DO psexec %%i -c c:\reg.bat
This works, but only for the "test.txt" file. I want to make it work for ALL txt files in the specified directory. When I replace (c:\txt\test.txt) with (c:\txt\*.txt) it doesn't work. It says that it cannot find "*.txt" (thinking *.txt is the file name).
I tried utilities like FORTUNE and FORALL but I don't really understand how to get it working in this case.
Can anyone help me?
Thnx in advance...