Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

PUSHD and POPD in MS-DOS 6.21? (Users)

posted by rr Homepage E-mail, Berlin, Germany, 11.03.2013, 21:01

> A BBS friend suggested I try PUSHD and POPD but I can't find them in my
> MS-DOS 6.21 manual.

These were introduced in Windows' cmd.exe.

> I'm wondering if DOS 6.21 might have equivalent commands, or if there's a
> way to get MS-DOS 6.21 accomplish the same thing using existing commands.

(Untested) from batfaq23.zip:

 9.          JUMP BACK TO PRIOR DRIVE / DIRECTORY
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Q: When I run a program or command how can I get back to the
     directory that was current prior to command execution ?
  A: Several solutions are available as small utilities but
     below is a pure DOS solution.(using environment variables)
     (4DOS has built in variables to deal with this situation)

     ::Set Envars to current drive & current directory
     @echo @prompt SET OLDRV$Q$N$_SET OLDIR$Q$P >C:\TEMP$TMP.BAT
     @%COMSPEC% /e:1024 /c C:\TEMP$TMP.BAT >C:\TEMP$$MP.BAT
     @call C:\TEMP$$MP.BAT >nul
     @del C:\TEMP$?MP.BAT

     Once this BATch has been CALL'd or run:
     %OLDRV% will be evaluated to be the drive when BAT was run
     and %OLDIR% will be evaluated to be the prior directory.

---
Forum admin

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum