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

Author Topic: DOS Command help needed  (Read 2065 times)

0 Members and 1 Guest are viewing this topic.

jojo1956

  • Guest
DOS Command help needed
« on: February 15, 2006, 09:01:00 AM »
I thought I knew DOS fairly well but I am having trouble with a batch file that was written by someone else and passed to me to run.  (That someone is no longer with the company) What does the following parameters mean in this line:


cd /d "%~dp0"

BTW - there are no parameters passed when the batch file is executed.  The procedure end result is actually working but I am trying to understand what this does.  


gpl



    Apprentice
  • Thanked: 27
    Re: DOS Command help needed
    « Reply #1 on: February 15, 2006, 11:45:26 AM »
    cd /d .... means change drive and directory
    %0 is the name of the program
    the modifier ~dp means take the drive and directory

    so basically, it just changes the current drive and directory to where the batch file resides

    Graham
    « Last Edit: February 15, 2006, 11:46:15 AM by gpl »