There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen blue screen of death boot bsod computer connection crash css dell display driver drivers email error excel firefox firefox 3 hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems ram router security slow sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Batch File auto return


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
jiggard's Avatar
Junior Member with 26 posts.
 
Join Date: Jun 2005
Experience: Advanced
05-Jul-2005, 04:07 PM #1
Batch File auto return
I have a batch file and I want it to del some files without asking me to enter yes all of the time. Is there a way to get my program to automatically enter a y then enter this value.
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
06-Jul-2005, 12:25 AM #2
Quote:
Is there a way to get my program to automatically enter a y then enter this value.
Yes. Assuming you are using a real DOS distribution (NOT the NT/WIN2K/XP command prompt), probably the simplest way is to use the deltree command with the /y option ("assume 'yes' to delete requests"). So, for example, instead of using:
del filename.ext
you would use:
deltree /y filename.ext

You can also create a file with a single 'Y' character in it, and redirect input to the del command from the file. For example, if the file that contains a single 'Y' character is named yes.txt, you could use:
del filename.ext < yes.txt
This should work on all DOS versions as well as the command prompts in NT/WIN2K/XP.

Hope this helps.
__________________
The slowest component still sits at the keyboard.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:13 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.