Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: What does FOR do?  (Read 2399 times)

0 Members and 1 Guest are viewing this topic.

Dark Blade

    Topic Starter
  • Forum Gaming Master


  • Adviser

    Thanked: 24
    • Yes
  • Experience: Experienced
  • OS: Windows XP
What does FOR do?
« on: May 02, 2007, 12:29:51 AM »
Can someone explain what the Command Prompt command FOR does?

I've tried reading the help file for it, but it is a BIT too complicated for me.

2k_dummy



    Specialist
  • A word, once spoken, can never be recalled.
  • Thanked: 14
    Re: What does FOR do?
    « Reply #1 on: May 02, 2007, 02:50:11 AM »
    Runs a specified command for each file in a set of files.

    FOR %variable IN (set) DO command [command-parameters]

      %variable  Specifies a replaceable parameter.
      (set)      Specifies a set of one or more files.  Wildcards may be used
      command    Specifies the command to carry out for each file.
      command-parameters
                 Specifies parameters or switches for the specified command.

    To use the FOR command in a batch program, specify %%variable instead of
    %variable.
    If you don't stand for something, you'll fall for anything.
    _______________________________________ ________
    BlackViper

    Software and utilities