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

Author Topic: DOS Command %  (Read 3164 times)

0 Members and 1 Guest are viewing this topic.

Nikki

    Topic Starter


    Newbie

    DOS Command %
    « on: September 10, 2010, 09:47:59 PM »
    How is this command used?

    Salmon Trout

    • Guest
    Re: DOS Command %
    « Reply #1 on: September 11, 2010, 01:26:49 AM »
    The percent sign (%) is not a "command".

    Nikki

      Topic Starter


      Newbie

      Re: DOS Command %
      « Reply #2 on: September 11, 2010, 04:56:08 PM »
      Is it used in DOS as a modifier?

      Fleexy



        Intermediate

      • OW NEXT TIME I SHOULD TURN IT OFF BEFORE SERVICING
      • Thanked: 2
        • Yes
        • Yes
      • Experience: Experienced
      • OS: Windows XP
      Re: DOS Command %
      « Reply #3 on: September 11, 2010, 06:31:39 PM »
      I think they go around variables, like this:

      Code: [Select]
      @echo off
      set %lol% = 1337
      echo %lol%

      I do not care if I did the set wrong.
      I love .NET!

      Salmon Trout

      • Guest
      Re: DOS Command %
      « Reply #4 on: September 11, 2010, 11:50:20 PM »
      I do not care if I did the set wrong.

      Then you are a fool.

      Percent signs are used to indicate expandable tokens to the command interpreter such as..

      Variables

      set var=rasputin
      echo %var%

      Metavariables used by FOR

      FOR %%A in (A B C D) DO echo %%A

      Passed parameters

      @echo off
      echo parameter 1 is %1
      echo parameter 2 is %2
      echo all parameters %*

      The name of a batch script

      echo this batch file is %0