Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You and Your Team.

Learn More →

Not for Novices

Not for Novices WIPEOUT You r Files Mark Bendig Microcomputer Specialist OCLC Office of Research Nested Batch Files Erasing Several Files Many PC users (especially "power users") like to create batch files to automate Have you ever gone through your diskettes repetitive processes; various examples of or hard disk subdirectories to weed out useful batch files have appeared in OCLC obsolete or unwanted files? It is easy Micro and other microcomputer maga­ enough to use the "? " and "* " wildcard zines. Sometimes you may want to write a characters to delete files with common ele­ batch file that, as part of its operation, ments in their names or extensions, using runs a second batch file and then returns commands like "ERASE *.BAK" or to continue with the original batch file. "ERASE RESULT?.DAT" but, if you want For example, if you wanted a batch to delete a group of files without common file that would run a program called elements to their names, you have to issue MYWORD, then erase three files called a separate ERASE command for each one. MW.TMP, REPORT.BAK, and LOGFILE, Until now! and finally run a second program called Here is a handy batch file I call DATABASE, you might try writing a batch WIPEOUT.BAT that allows you to delete file like: multiple files with a single command: MYWORD ECHO OFF WIPEOUT MW.TMP REPORT.BAK LOGFILE :LOOP DATABASE IF ×%1 = = × GO TO DONE (WIPEOUT is the batch file to delete multi­ IF EXIST %1 GOTO OKFILE ple files that was just described.) The only ECHO File % 1 not found problem with this batch file is it won't GOTO PROCEED work. It will run the program called :OKFILE MYWORD; it will transfer control to ERASE %1 WIPEOUT and delete the three files. But it :PROCEED will not come back from WIPEOUT and SHIFT run DATABASE. GOTO LOOP Fortunately, there is an easy way out :DONE of this jam. The batch file that does the job Since this column isn't intended for looks like this: novices, I've assumed you know how to MYWORD create a batch file; to use WIPEOUT.BAT, COMMAND/C WIPEOUT MW.TMP REPORT BAK LOGFILE type WIPEOUT followed by the names of DATABASE the files you want to delete, separated by spaces. For example, the command The only change is the addition of COM­ MAND/C before the reference to the sec­ WIPEOUT SAMPLE.TXT RESULT1.DAT TEST.BAS ondary batch file. would delete the files SAMPLE.TXT, A bit of technical background: The RESULT1.DAT, and TEST.BAS from your COALMAND/C invokes a second copy of disk with a single command. the DOS command processor COM- MAND.COM. This second copy of COM- MAND.COM runs the secondary batch file and then terminates, returning control to the original batch file. Nothing to it! 2 8 OCLC Micro Vol. 2, No. 4 Aug. 1986 http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png OCLC Micro Emerald Publishing

Not for Novices

OCLC Micro , Volume 2 (4): 1 – Apr 1, 1986

Loading next page...
 
/lp/emerald-publishing/not-for-novices-4pB6rlfpr9
Publisher
Emerald Publishing
Copyright
Copyright © Emerald Group Publishing Limited
ISSN
8756-5196
DOI
10.1108/eb055791
Publisher site
See Article on Publisher Site

Abstract

WIPEOUT You r Files Mark Bendig Microcomputer Specialist OCLC Office of Research Nested Batch Files Erasing Several Files Many PC users (especially "power users") like to create batch files to automate Have you ever gone through your diskettes repetitive processes; various examples of or hard disk subdirectories to weed out useful batch files have appeared in OCLC obsolete or unwanted files? It is easy Micro and other microcomputer maga­ enough to use the "? " and "* " wildcard zines. Sometimes you may want to write a characters to delete files with common ele­ batch file that, as part of its operation, ments in their names or extensions, using runs a second batch file and then returns commands like "ERASE *.BAK" or to continue with the original batch file. "ERASE RESULT?.DAT" but, if you want For example, if you wanted a batch to delete a group of files without common file that would run a program called elements to their names, you have to issue MYWORD, then erase three files called a separate ERASE command for each one. MW.TMP, REPORT.BAK, and LOGFILE, Until now! and finally run a second program called Here is a handy batch file I call DATABASE, you might try writing a batch WIPEOUT.BAT that allows you to delete file like: multiple files with a single command: MYWORD ECHO OFF WIPEOUT MW.TMP REPORT.BAK LOGFILE :LOOP DATABASE IF ×%1 = = × GO TO DONE (WIPEOUT is the batch file to delete multi­ IF EXIST %1 GOTO OKFILE ple files that was just described.) The only ECHO File % 1 not found problem with this batch file is it won't GOTO PROCEED work. It will run the program called :OKFILE MYWORD; it will transfer control to ERASE %1 WIPEOUT and delete the three files. But it :PROCEED will not come back from WIPEOUT and SHIFT run DATABASE. GOTO LOOP Fortunately, there is an easy way out :DONE of this jam. The batch file that does the job Since this column isn't intended for looks like this: novices, I've assumed you know how to MYWORD create a batch file; to use WIPEOUT.BAT, COMMAND/C WIPEOUT MW.TMP REPORT BAK LOGFILE type WIPEOUT followed by the names of DATABASE the files you want to delete, separated by spaces. For example, the command The only change is the addition of COM­ MAND/C before the reference to the sec­ WIPEOUT SAMPLE.TXT RESULT1.DAT TEST.BAS ondary batch file. would delete the files SAMPLE.TXT, A bit of technical background: The RESULT1.DAT, and TEST.BAS from your COALMAND/C invokes a second copy of disk with a single command. the DOS command processor COM- MAND.COM. This second copy of COM- MAND.COM runs the secondary batch file and then terminates, returning control to the original batch file. Nothing to it! 2 8 OCLC Micro Vol. 2, No. 4 Aug. 1986

Journal

OCLC MicroEmerald Publishing

Published: Apr 1, 1986

There are no references for this article.