Loading ...
Sorry, an error occurred while loading the content.

Recycle bin for DOS

Expand Messages
  • Bill
    Is it possible to simulate a recycle bin using batch files? Bill
    Message 1 of 5 , Jan 19, 2005
    • 0 Attachment
      Is it possible to simulate a "recycle bin" using batch files?

      Bill
    • dennis.p.morgan@verizon.com
      You should have a hidden folder called Recycler off the root of Drive C (depending on operating system). You could copy the file to that folder before
      Message 2 of 5 , Jan 19, 2005
      • 0 Attachment
        You should have a hidden folder called "Recycler" off the root of Drive
        "C" (depending on operating system). You could copy the file to that
        folder before doing a DOS delete. Or you could just create a folder (your
        name choice) and copy it/them to it before doing anything it/them.

        UNTESTED Example

        Create a bat-file perhaps named "sDel.BAT" standing for safe delete
        ==========================
        COPY <whatever> c:\recycler
        DEL <whatever>
        ===========================

        Then, down the road, I think you could use the Recycle Bin to really get
        rid of them when you feel safe.





        "Bill" <roswellbill46@...>
        01/19/2005 01:45 PM
        Please respond to batchworld

        To: batchworld@yahoogroups.com
        cc:
        Subject: [BATCH WORLD] Recycle bin for DOS



        Is it possible to simulate a "recycle bin" using batch files?

        Bill





        To Post a message, send it to: batchworld@...

        To Unsubscribe, send a blank message to:
        batchworld-unsubscribe@...


        Yahoo! Groups Links
        To visit your group on the web, go to:
        http://groups.yahoo.com/group/batchworld/

        To unsubscribe from this group, send an email to:
        batchworld-unsubscribe@yahoogroups.com

        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        [Non-text portions of this message have been removed]
      • Mic
        ... Bill, is this for MSdos with short filenames? I have an idea but need more info. -- Regards, Mic
        Message 3 of 5 , Jan 20, 2005
        • 0 Attachment
          On Wed, 19 Jan 2005 18:45:33 -0000, Bill wrote:

          > Is it possible to simulate a "recycle bin" using batch files?
          >
          > Bill

          Bill, is this for MSdos with short filenames? I have an idea but need more
          info.

          --
          Regards,
          Mic
        • Mic
          ... Here s my idea, see if it suits. All lines start in column 4 so any lines in column 1 have wrapped. @echo off if [%1]==[/?] %0 if [%1]==[] echo.Purpose:
          Message 4 of 5 , Jan 20, 2005
          • 0 Attachment
            On Thu, 20 Jan 2005 19:29:33 +1100, Mic wrote:

            > On Wed, 19 Jan 2005 18:45:33 -0000, Bill wrote:
            >
            >> Is it possible to simulate a "recycle bin" using batch files?
            >>
            >> Bill
            >
            > Bill, is this for MSdos with short filenames? I have an idea but need more
            > info.

            Here's my idea, see if it suits. All lines start in column 4
            so any lines in column 1 have wrapped.

            @echo off
            if [%1]==[/?] %0
            if [%1]==[] echo.Purpose: Dos Recycle bin
            if [%1]==[] echo.
            if [%1]==[] echo. Syntax: DR [Drive:\Path\]filespec.ext
            if [%1]==[] echo.
            if [%1]==[] echo.Description: This is designed to create a recycle scheme
            if [%1]==[] echo. for MSDOS when using short filenames.
            if [%1]==[] echo. It will move the file(s) to be deleted to
            if [%1]==[] echo. a directory called DOSCYCLE in the root directory
            if [%1]==[] echo. of the appropriate drive.
            if [%1]==[] echo.
            if [%1]==[] echo. If the path of the file is specified then it will
            if [%1]==[] echo. create the same path under the DOSCYCLE directory
            if [%1]==[] echo.
            if [%1]==[] echo. Tested in XP :)
            if [%1]==[] goto :EOF

            if exist %temp%.\edl.com goto :skip
            :: ascii assembler line processing utility by Herbert Kleebauer
            :: for the source code and usage information, use this URL
            :: http://groups.google.com.au/groups?q=Usage:+edl
            ::
            echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>%temp%.\edl.com
            echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>%temp%.\edl.com
            echo ?@}I{uNWEF~NPCkaEFAKLCmaIj@KguHaEFCKYCmavh@{HM?cCiuGGwHmYz>>%temp%.\edl.com
            echo CgisCGH`LbuuGNO@hRgco{W?dOGg@N?]gBgoG}G?X_SgONks?GN`LBgDu}>>%temp%.\edl.com
            echo G?I_DgGNoG?w@jgLiuuroD@?FHoGpBBDcB?1?pIoCRaICSbICn}ExvHmE?>>%temp%.\edl.com
            echo coF?DO~yanxCqap?@?lpZrH~sa`LyNHKqDGwQVTNG`CiECICtdL{D?{esL>>%temp%.\edl.com
            echo ysICu_{OuD@sCREGHt~F@lgNHYq`EE{S~{Hq_gC{Lr@CE{HQ}@ExuCNQmB>>%temp%.\edl.com
            echo BwjFCs?osqs?}n`LKLj?o{}HwJvClpCSEGt~~1}HGGHCSaCU}GiuJaxLCS>>%temp%.\edl.com
            echo c}BWuNC_FE{sCkEGFAPqCmEGNAcQNJwLECuQsa{Oe~CK~CkqCmeGmEFbCN>>%temp%.\edl.com
            echo C?kEFbBaCGH1jnjBrz?JAcqo~O~?lJgvxs~CspajF{oFEBHijnjBrz?JAc>>%temp%.\edl.com
            echo vx~O~?QJLqos~CspFjN{xFEByijnj@ComJcIpCSAijZNUmJaujC{U]JaJB>>%temp%.\edl.com
            echo CcClmCJ\jbCS]GFrj~CkEGjBSookVBA_@NJBHmClnEj1JYjxCoIBrh{BFC>>%temp%.\edl.com
            echo HtdCWECaBsCC@ZgB@WgB}fj~BsMV@NgB~chvsb{Os{AR{msDUsycsk{SK{>>%temp%.\edl.com
            echo VQ{ZsH\sQdsq{Sj{cAICNWl{~B1CNW_K~BxVkSfCA?Cb@N}W@{=sIfjBH}>>%temp%.\edl.com
            echo G}N}NK}NNguM@[umCqBJqD@mzDCCClmCJFuhClmC{@jJSN?`CWEG{Cs@Pt>>%temp%.\edl.com
            echo cc?AyAFZp{CkEGjBEpEFDNCCkq=jBktx{S[zDgsjCKtl{S]zDgjjCKtc{S>>%temp%.\edl.com
            echo _zDgajCKtG{SazDgXjCKtL{SczDgOjCKtR{SezDgFjCKtX{SYzMgFICG?K>>%temp%.\edl.com
            echo gF@FIE?EgF}ZhziEuRN~CK}~DqgLoqo?t_ogIKEh?{JU=fCguGiuz_FrCC>>%temp%.\edl.com
            echo sCyOjEEsjwr~EvPK~CSqCt~FS}Ha}HCGxCUqERNG]CRQa_BfsCoaoy?h@x>>%temp%.\edl.com
            echo CGJH?w``LRaDBBobc?q?a_q?C_0x>>%temp%.\edl.com

            :: Usage: edl "string1" "string2" <infile.ext >outfile.ext
            ::
            :: Replaces all non empty lines in the infile by string2 and
            :: writes it to the outfile. (a line considered non empty if
            :: it contains at least one character greater than hex 0x20)
            ::
            :: All characters in string1 are used as delimiters in the input line.
            ::
            :: Example: echo Fi.le.na.me.ext|edl "." "$22$$L$22"
            :: returns just "Fi.le.na.me"
            ::
            :: string2 can contain any mixture of the following:
            :: $00 to $ff : hex numeral of ASCII character ($22=" $24=$ $41=A $61=a)
            :: $:abcd : input line range,in hex ($:0105 is characters 1 to 5)
            :: ($:03ff is characters 3 to 255)
            :: $#0 : complete input line
            :: @#0 : complete input line (doubles % for use in batch files)
            :: $#n (n=1..8) : nth word in input line from 1st to 8th
            :: $#9 : last word in input line from 9th onward
            :: $l : input line until the first delimiter char
            :: $L : input line until the last delimiter char
            :: $r : input line from the first delimiter char onward
            :: $R : input line from the last delimiter char onward
            :: $+ : increment the number before $+ (001$+)
            :: $- : decrement the number before $- (002$-)
            :: $tY : year - leading 2 digits (20 for 2003)
            :: $ty : year - trailing 2 digits (13 for 2013)
            :: $tm : month - 2 digits
            :: $td : day - 2 digits
            :: $tH : hour - 2 digits in military time (23:00 is 11pm)
            :: $tM : minute - 2 digits
            :: $tS : second - 2 digits
            ::
            :: replace $xx with @xx and all % signs are then doubled

            :skip
            :: Initialise variables
            set drv=
            set pth=
            set fil=%1
            :: Detect spaces in the path\filespec etc
            echo.!%2!|find "!!">nul
            if errorlevel 1 echo Only short path/filenames please
            if errorlevel 1 echo.
            if errorlevel 1 %0
            echo.%1|find " ">nul
            if not errorlevel 1 echo Only short path/filenames please
            if not errorlevel 1 echo.
            if not errorlevel 1 %0
            : Detect if a path is part of the filespec
            echo %1|find "\">nul
            if errorlevel 1 goto :skip2
            :: extract drive letter and path\filename
            echo %1|%temp%.\edl.com ":" "set drv=$l:$0a$0dset pth=$r">%temp%.\edlbat.bat
            call %temp%.\edlbat.bat
            del %temp%.\edlbat.bat
            :: If no drive letter was specified then correct the PTH and DRV variables
            if "%pth%"=="" set flag=!
            if "%flag%"=="!" set pth=%drv%
            if "%flag%"=="!" set drv=
            :: set the path and filename variables
            echo %pth%|%temp%.\edl.com "\" "set pth=$L$0a$0dset fil=$R">%temp%.\edlbat.bat
            call %temp%.\edlbat.bat
            del %temp%.\edlbat.bat
            :skip2
            :: detect if the doscycle directory exists and create it if needed
            dir /b /a:d /-p %drv%\|find /i "doscycle">nul
            if errorlevel 1 MD %drv%\doscycle\
            :: create the path within the \DOSCYCLE folder to receive the file(s)
            xcopy %temp%.\edl.com %drv%\doscycle%pth%\ >nul
            del %drv%\doscycle%pth%\edl.com
            :: Actually recycle the file here
            echo Recycling - %drv%\doscycle%pth%\%fil%
            move /y %1 %drv%\doscycle%pth%\ >nul
            pause
            :EOF
            set flag=
            set pth=
            set drv=
            set fil=



            --
            Regards,
            Mic
          • Bill Weller
            ... I was impressed with what could be done with Arachne web browsers ability to execute DOS apps from HTML about 5 years ago, and started making custom
            Message 5 of 5 , Jan 20, 2005
            • 0 Attachment
              --- Mic <micm@...> wrote:


              >
              > Bill, is this for MSdos with short filenames? I
              > have an idea but need more
              > info.
              >
              > --
              > Regards,
              > Mic
              >
              I was impressed with what could be done with Arachne
              web browsers ability to execute DOS apps from HTML
              about 5 years ago, and started making custom desktops
              for the women at work to make life easier. Anything
              that can be done on a webpage can be incorporated into
              the desktop.

              On a 386 (7 meg RAM) it was faster with dial-up than
              the machines in the building that were on the backbone
              of the server upstairs.

              I abandoned the project when Arachne went out of
              development for over two years. But now it has come
              back as GPL, and is being updated regularly. JAVA is
              in the works, and has matured to 386+ status.

              My disgust with bloatware caused me to start a Yahoo
              group in an attempt to develop it into an ´┐Żoperating
              system´┐Ż.

              http://groups.yahoo.com/group/arachneos/

              Web page here: http://www.geocities.com/arachne_os/

              Longer story than I wished to post as an answer,
              but...

              __Short file names
              __Run from RAM drive
              __Recycle bin usable from the Arachne shell

              Thank you for the impressive batch you posted for me.
              It may take me a while to test it thoroughly.

              Bill




              __________________________________
              Do you Yahoo!?
              Yahoo! Mail - Find what you need with new enhanced search.
              http://info.mail.yahoo.com/mail_250
            Your message has been successfully submitted and would be delivered to recipients shortly.