Knowledge Base

FOR Command Behaves Differently From Previous MS-DOS Versions

Article ID: 134572

Article Last Modified on 11/15/2006


APPLIES TO


This article was previously published under Q134572

SYMPTOMS

After you install Windows 95, you notice that batch files that use the FOR command with the slash (/) switch behave differently:

For example, the following line
   for %i in (/abcd) do echo %i
				
prints
   /ABCD
				
whereas in previous versions of MS-DOS it printed
   A
   BCD
				

CAUSE

The FOR command with the slash (/) switch in Command.com in Windows 95 behaves differently than it did in previous versions of Command.com.

RESOLUTION

Rewrite batch files that use the FOR command with the slash (/) switch.

Additional query words: program

Keywords: KB134572