Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

QBASIC *.CPY Deleter

Person157Person157 Member Posts: 1
Can anyone think of a way to write a program that can delete *.CPY files? They are usually found in C:_RestoreTemp and can't be viewed in Windows. The only way I know how to delete them is by using DOS and the DELTREE command. This works but I had 5000 *.CPY files and DOS made me enter whether I wanted to delete each one or not. It took about 20mins of constant button mashing.

Comments

  • ninchagoraninchagora Member Posts: 82
    : Can anyone think of a way to write a program that can delete *.CPY files? They are usually found in C:_RestoreTemp and can't be viewed in Windows. The only way I know how to delete them is by using DOS and the DELTREE command. This works but I had 5000 *.CPY files and DOS made me enter whether I wanted to delete each one or not. It took about 20mins of constant button mashing.
    :

    If DOS command DIR can display hidden or system files (if *.CPY have such attributes), then you could invoke it via BASIC's SHELL statement.

    See help for DIR (DIR/?) to see which switch is for displaying filenames only.

    If you redirect DIR's output to a file via >, then you could read this file in BASIC, and retrieve filenames you want to delete.


    But, why can't you view those files in Windows - it can show hidden and system files.

  • mr_orchemr_orche Member Posts: 12
    : Can anyone think of a way to write a program that can delete *.CPY files? They are usually found in C:_RestoreTemp and can't be viewed in Windows. The only way I know how to delete them is by using DOS and the DELTREE command. This works but I had 5000 *.CPY files and DOS made me enter whether I wanted to delete each one or not. It took about 20mins of constant button mashing.


    try following two lines, it must be work!!!
    SHELL "ATTRIB -H -R -S C:_RestoreTemp*.CPY"
    SHELL "DEL C:_RestoreTemp*.CPY"




Sign In or Register to comment.