Automate answer to a "System Prompt" ? ( Batch File clean up folders )

  • Thread starter Thread starter Angela
  • Start date Start date
A

Angela

Hello,
I have a batch file that I would like to run each night at 7 pm on all
of our pc here at work.
it calls the CLEANMGR.EXE /sageun:11.
however, it does not completely clean out the Documents and
Settings\me\Local Settings\Temp

in this folder, are a combo of *.XLS, *.DOC, *.LOG, etc....

In my batch file, it prompts me to " are you sure you want to delete
these files?" where I would have to type in a "Y".


Is their a way to automate the "Y" ?

no command for " autoreply yes"
.....LOL....



Any help will be grateful, for I have searched high and low not to
bother anyone with this question....I am stumped....
 
Angela said:
Hello,
I have a batch file that I would like to run each night at 7 pm on all
of our pc here at work.
it calls the CLEANMGR.EXE /sageun:11.
however, it does not completely clean out the Documents and
Settings\me\Local Settings\Temp

in this folder, are a combo of *.XLS, *.DOC, *.LOG, etc....

In my batch file, it prompts me to " are you sure you want to delete
these files?" where I would have to type in a "Y".


Is their a way to automate the "Y" ?

no command for " autoreply yes"
....LOL....



Any help will be grateful, for I have searched high and low not to
bother anyone with this question....I am stumped....

Running a batch file under Windows 98 i used to add <Y to the end of the
command line.
The command would interpret the Y as user input.
So instead of using scanreg /backup and being promted for Yes/No type of
confirmation, i'd use scanreg /backup<Y and no user input was required.
Of course any other character(s?) could follow the less than, but that was
the general syntax.

I don't know whether XP's Command Prompt supports this so you'd need to
experiment.

Martin.
 
Also files aren't deleted till they are 7 days old. This can be changed or you can make your own cleaners.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\CustomDeleter]
@="{C0E13E61-0CC6-11d1-BBB6-0060978B2AE6}"
"FileList"="*.fred"
"Folder"=hex(2):63,00,3a,00,5c,00,64,00,65,00,73,00,6b,00,74,00,6f,00,70,00,00,\
00
"Flags"=dword:00000000
"LastAccess"=dword:00000002
"StateFlags"=dword:00000001
"Display"="Custom"
"Description"="Clears a custom folder"

To make multiple cleaners just change the last key name (CustomDeleter)

Seperate multiple filetypes like so (pipe)
*.fred|*.horse

Seperate multiple directories the same way.
c:\desktop|C:\games

Use this syntax for directories
?:\recycled

Which will do all drives or the specified drive (depending on how cleanup is being used)

Last Access can be set to 0 for instant deleting.
 
Back
Top