Current directory in environment variable?

Posted on 2007-07-22
Last Modified: 2012-05-05
How do I get the current directory from the cd command into an environment variable? Use the set command somehow?
Question by:guy-pc
    LVL 30

    Accepted Solution

    set currentdir=%cd%
    LVL 66

    Expert Comment

    Mind if I ask what you are trying to accomplish?
    LVL 30

    Expert Comment

    No reason for a B... You happen to ask a simple question. Just because the answer was simply answered it doesn't mean that it wasn't the best answer...

    Lord I do dislike the grading system's effect on point distribution. Just plain stupid.
    LVL 30

    Expert Comment

    Oh, your a newbie and don't understand the grading system... So sorry :)

    There's another reason for disliking the grading system.

    My free advice to you for success on EE. Always grade with an A. It doesn't cost you anything and doesn't cause bad blood.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
    Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now