Skip to Content


Hi All,

We use 'pushd' command to map a network drive for copying or deletion of files. I have seen the temporary drive letter is automatically getting deleted without using the 'popd' command which is created by pushd. Is Redwood capable of doing this automatically?. Please advise.

Please see below example.

@echo off

pushd \\SRVABC\Redwood\out\

if exist test.txt (
MOVE /y \\SRVABC\Redwood\out\test.txt \\SRVDEF\Redwood\in\
echo test.txt "copied to DEF server"
) else (
echo test.txt "not found"
exit /b 1



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 14, 2015 at 08:03 PM

    Hi Tinku,

    No magic, there.

    You can reproduce with two cmd.exe sessions.

    Open cmd.exe twice and type in the first:

    pushd \\SRVABC\Redwood\out\

    you will end up in a mapped drive, like z:\

    in the second cmd.exe, type:

    dir z:\

    And you will see the contents.

    Close the first cmd.exe.

    Type dir z:\ in the lone (second) cmd.exe

    You get "The system cannot find the path specified."

    Once a CMD process completes in CPS, it is terminated ... any mapped drive using pushd is removed as well (standard Windows behavior).

    Issue "net use" if you want persistent shares.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.