Loading ...
Sorry, an error occurred while loading the content.

7937Re: DOS batch question

Expand Messages
  • John Zeman
    Mar 25, 2008
      %1 represents the first argument you send to a batch file or even to
      another program.

      So what %1 actually is, depends upon what you are doing.

      For example, suppose you create a batch file named runme.bat and the
      contents of that batch file are:

      echo Hello, %1 %3

      From a Command prompt in the directory where runme.bat resides type:

      Runme Johnny Susan Joy

      And the result you should see would be: "Hello, Johnny Joy"


      --- In ntb-OffTopic@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
      > I need to write a batch that receives a full path as %1
      > Question one: Can I change that in W98 regedit? It currently has
      > mypath/mybat.bat "%1"
      > in it. Could I send path and file as different parameters?
      > Assuming the answer to question 1 is no, can I do it inside the batch?
      > I first need to issue a chdir %1, which won't work of course, without
      > dropping the file.
      > I then need to use the filename without extension in further commands.
      > Are there any batch commands or utilities to do that? It's easy in
      > pascal, but I don't wont to go that length.
      > Danke
      > Axel
    • Show all 7 messages in this topic