Removing the current directory

Removing the current directory

Post by Ben Hambid » Tue, 10 May 1994 20:50:59



Anyone got an alias for wiping the contents of the current directory, then going up to the
parent directory and removing the one that you were just in?

Ben

 
 
 

Removing the current directory

Post by Michael Scha » Tue, 10 May 1994 21:55:28



>Anyone got an alias for wiping the contents of the current directory, then going up to the
>parent directory and removing the one that you were just in?
>Ben

You should have a look at RMD. It does thsi and much more.

You can ftp it from oak.oakland.edu:/SimTel/msdos/4dos/rmd200.zip

    Michael

--


 \--/=/ Keizersgracht 62-64           |  Phone number    | - The Giant
  \/\/  1015 CS  Amsterdam            | +31-20-5207550   |        in Twin Peaks

 
 
 

Removing the current directory

Post by Wietse D » Tue, 10 May 1994 22:01:45


Anyone got an alias for wiping the contents of the current directory, then going
    up to the
parent directory and removing the one that you were just in?

Really simple:
alias deldir=`set DELETEDIR=%_CWDS^cd ..^del %DELETEDIR /szxqy^unset DELETEDIR`

I do not like these commands (an error and you have lost your data!). So take
your time and write a good batch file that also does some checking before it
deletes the directory!

Greetings,

Wietse

+------------------------------------------------------------+

+------------------------------------------------------------+
| Work:                           | Private:                 |
|   Landbouw Economisch Instituut |                          |
|   Conradkade 175                |   Zonnedauwtuin 11       |
|   2517 CL Den Haag              |   2317 MR  Leiden        |
|   The Netherlands               |   The Netherlands        |
|   tel:+31 (0)70-3308135         |   tel: +31 (0)71-210642  |
+------------------------------------------------------------+

 
 
 

Removing the current directory

Post by Janne Kukonleh » Tue, 10 May 1994 21:56:25



> Anyone got an alias for wiping the contents of the current directory,
> then going up to the parent directory and removing the one that you
> were just in?

> Ben

Something like following should work. This one asks no confirmation
so be careful.

alias zap='set dir=%_cwd ^ cd .. ^ del /sxyz %dir ^ unset dir'

--

 
 
 

Removing the current directory

Post by Coug » Wed, 11 May 1994 02:58:42



>Anyone got an alias for wiping the contents of the current directory, then going up to the
>parent directory and removing the one that you were just in?

>Ben

I use an alias "NUKE".

You have to start in the parent dir, but you simply type
      NUKE DIRNAME
and it will remove _ANYTHING_ in that directory (including subdirs), and the
dir itself.

The alias is:

      NUKE   DEL /S /Z /Q /X /Y

This requires DOS 6.00 minimum and 4DOS 4.00 minimum.

Watch out!  This command requires no user input and can easily erase
everything on your hard disk if you type NUKE \  !

-Cougar
dan neuwirth

 
 
 

Removing the current directory

Post by BISEXUAL, GAY & LESBIAN ASSOCIATION OF DALHOUS » Wed, 11 May 1994 10:27:15



> Anyone got an alias for wiping the contents of the current directory, then going up to the
> parent directory and removing the one that you were just in?

Here is my 'nuke' alias that wipes-out an entire directory and all it's
subdirectories, regardless of the file attributes.

alias nuke DEL /Q/S/Y/X/Z %&

/q=quiet mode
/s=act on subdirectories too
/y=assume yes response to everything
/x=remove empty subdirectories
/z=zap all files regardless of their attributes

eg.
NUKE dirname  (wipes-out entire directory structure of dirname and below)

This is a very powerful and potentially dangerous command.  You must be
absolutely sure that you wish to wipe out the directory and all its sub's.
I have only once made the mistake of wiping out an entire directory
structure that I did not intend to.  I was on the wrong drive when I
typed the command, and unfortunately that drive just happened to have
a directory with the same name as the drive that I had intended to nuke.
Also, when you delete a directory structure using this method, it is
very difficult to recover the files, even with Norton Utilities.  If you
have a deletion tracker program running, then it gets easier.  Anyway,
I have found the command to be very useful.

Francis

 
 
 

Removing the current directory

Post by Michael Scha » Wed, 11 May 1994 21:44:26



>I use an alias "NUKE".
>You have to start in the parent dir, but you simply type
>      NUKE DIRNAME
>and it will remove _ANYTHING_ in that directory (including subdirs), and the
>dir itself.
>The alias is:
>      NUKE   DEL /S /Z /Q /X /Y
>This requires DOS 6.00 minimum and 4DOS 4.00 minimum.
>Watch out!  This command requires no user input and can easily erase
>everything on your hard disk if you type NUKE \  !

That's why I use a program called RMD, available by FTP from
oak.oakland.edu:/SimTel/msdos/4dos/rmd200.zip

There are several safeguards in that program. It will warn you, for instance,
if you try to delete a root directory, or a directory that's higher than
the current directory. There's also an environment variable NO_RMD in which
you can specify directories that should never be deleted.

    Michael

--


 \--/=/ Keizersgracht 62-64           |  Phone number    | - The Giant
  \/\/  1015 CS  Amsterdam            | +31-20-5207550   |        in Twin Peaks

 
 
 

Removing the current directory

Post by Jeroen Eeuw » Thu, 12 May 1994 03:13:36


 C> You have to start in the parent dir, but you simply type
 C>       NUKE DIRNAME
 C> and it will remove _ANYTHING_ in that directory (including
 C> subdirs), and the  dir itself.


...isdir %d then^del %d/sxyz^else^echo %d isn't a directory!^ve^endiff^...
...popd>&nul)

Connect at the dots and remove them; note that 've' is an alias for an
error-announcement! It'll probably give an error on your system, but you can
just delete it without losing much :-)

Works for me, and I run MS-DOS 5.0. Don't know why your NUKE needs 6.00.
Perhaps you are confused with DELTREE (I think) which is in DOS 6.x?

I have an alias rdq which uses the q switch too, but I usually want to see
what garbage I'm deleting. And if something does go wrong you could break the
del command which saves a lot of undeleting.

 
 
 

Removing the current directory

Post by Julio Pacheco Troncoso/Syndar at Carrion Fields M » Fri, 13 May 1994 23:54:23




> >Anyone got an alias for wiping the contents of the current directory,
> >then going up to the parent directory and removing the one that you
> >were just in?
> >Ben
> You should have a look at RMD. It does thsi and much more.
> You can ftp it from oak.oakland.edu:/SimTel/msdos/4dos/rmd200.zip
>     Michael

        This is a much more user-friendly alias for removing trees,
        and i prefer it to MS-DOS 6.x deltree:

        alias deltree=`iff %&.==. then^select /ad del /sqxz (.)^else^
                        del /sqxz %&^endiff`

        Then, if you simply type "deltree" with no arguments, it shows
        you a screen with all the available subdirs to delete, and if
        the alias is called with arguments, as in "deltree subdir1 subdir2
        subdir3 ... subdirn", it prompts if you really want to delete these
        subdirs, and if your response is "Y", *POUF* they're gone.

--
 +-----------------------------------+---------------------------------------+
 |                                   | HARVARD'S LAW,AS APPLIED TO COMPUTERS |
 |    Julio I. Pacheco Troncoso      + --------------------------------------+
 |    Ingenieria Civil Electrica     | UNDER THE MOST RIGOROUSLY CONTROLLED  |
 |    Universidad de Concepcion      | CONDITIONS OF PRESSURE,TEMPERATURE,   |
 |              Chile                | VOLUME,HUMIDITY AND OTHER VARIABLES,  |

 |                                   | PLEASES.                              |
 +---------------------------------- + --------------------------------------+

 
 
 

Removing the current directory

Post by hairf.. » Sun, 15 May 1994 03:57:42


To all,

   The del [subdirectory] /yqszx command is great and works well,
but don't try to do this selectively using the except command - it
can do some unexpected things.  I forgot that 'except' normally works
on files only, and from the root directory launched the following
command:

except (dos 4dos etc bin) del *.* /yqszx

This was supposed to clear out the entire disk except for the directories
dos, 4dos, etc, and bin, but since they were directories and not files,
it didn't have the desired effect.  In fact, taking only a few seconds,
all the data on the hard disk was gone.  Luckily, I
was still connected to my network and had very recently done a full
image backup, so I only lost 20 minutes.  Without a network, or without
a recent backup, I would have been hosed.

Bottom line:  Be careful!

Dave

 
 
 

Removing the current directory

Post by Aaron Maras » Sun, 15 May 1994 23:32:49



>To all,

>   The del [subdirectory] /yqszx command is great and works well,
>but don't try to do this selectively using the except command - it
>can do some unexpected things.  I forgot that 'except' normally works
>on files only, and from the root directory launched the following
>command:

>except (dos 4dos etc bin) del *.* /yqszx

That's because 'except' just makes them hidden. del /z deletes hidden
files. Oops.

--
where did my .sig go?

 
 
 

Removing the current directory

Post by Werner Icki » Wed, 18 May 1994 05:20:16




>>To all,

>>   The del [subdirectory] /yqszx command is great and works well,
>>but don't try to do this selectively using the except command - it
>>can do some unexpected things.  I forgot that 'except' normally works
>>on files only, and from the root directory launched the following
>>command:

>>except (dos 4dos etc bin) del *.* /yqszx

>That's because 'except' just makes them hidden. del /z deletes hidden
>files. Oops.

As I said earlier: "except" should be renamed to "except-sometimes"!
"Except" is misdesigned.

4dos enhanced a lot of simple dos-commands by adding /s. Why didn't
they enhance "except"?

They found a feature in DOS (hidden files) which (only) sometimes
works well; therefor "except" works only sometimes well.

Have a look at the example in the (version 4) docs:

  except (memo*.* *.wks) del *.*

A user who believes in the power of 4dos assumes that

  except (memo*.* *.wks) del /s *.*

will do good job.

Please, please: re-implement "except" without using "hidden files".
It will use some more time, but it will be a lot safer. You may
than add an "unsafe, but quick" switch for those who like such a
behaviour.

Werner
--

GMD - Gesellschaft fuer Mathematik und Datenverarbeitung mbH          _`\<,_
Schloss Birlinghoven, D-53754 Sankt Augustin, Germany                (_)/ (_)
                         "Der Dativ ist dem Genitiv sein Tod." ~~~~~~~~~~~~~~~

 
 
 

1. getting the current directory so that it can be SET to a variable?

N> how do I set a variable to the value of the current path?

Various command interpreters provide implicit environment variables
containing handy values.  (So, in fact, you may not need to set
_another_ environment variable at all).

In all of JP Software's command interpreters (4DOS, 4OS2, 4NT, TCWIN16,
TCWIN32, TCOS2) the implicit environment variable containing the current
directory name is %_CWD%.  This is consistent across all platforms.

There is no implicit environment variable containing the current
directory name in Microsoft's CMD from Windows NT 4.

In Microsoft's CMD from Windows NT 2000 and later, the implicit
environment variable containing the current directory name is %CD%.

2. Merry Christmas!!

3. creating directory with current date

4. Calling

5. current working directory in variable

6. Epson Stylus 800 will not init.

7. 4NT Title command: show current directory??

8. Q: mail filter program (auto save/print) ?

9. List subdirectory in current directory

10. 4DOS 6.00: Current directory not in history list!

11. Tip: starting RHIDE in its own DOS window in current directory

12. renaming directory based on current date

13. System variable for Win98 Current Directory?