1.

Solve : Script runs in CMD window but not from .bat file?

Answer»

I have this string that I use to read a directory of files and then process them according to the second part of the string.

WORKS fine when i directly enter it into a CMD window, but when writing it into a .bat file, the CMD flashes and goes AWAY WITHOUT processing the files. The directory may contain up to 4000 files and what I am trying to do is loop through each file in the directory and insert the data into a Database. And as I said, works fine when I manually PASTE it into a CMD window, but when running from .bat file, doesn't work.

Here is the string.. any suggestions?

for /f %A IN ('dir /b C:\scripts\files\work\out\*.txt') do call LOAD AR01 -file "C:\scripts\files\work\out\%A" -addAt command prompt FOR variables have one percent sign: %A

In a batch script they have two percent signs: %%A




Discussion

No Comment Found