SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Software > Software Problems and Useful Utilities
User Name
Password


BAT & command

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes

  #1  
Old 03-28-2005, 05:12 PM
Cyhaxor Offline
Registered User
 
Join Date: Mar 2005
Posts: 3
Question BAT & command

ok guys i create a del.bat file and put it in C:\Documents and Settings\user\Desktop\BAT\ then i wrote the folowing script

cd..
cd..
cd..
cd..
del *.tmp /s

a cmd window open for 2-3secs and after finish its closed automatic... how i can keep this window open till i close it manual?
Reply With Quote

  #2  
Old 03-28-2005, 05:56 PM
Cache's Avatar
Cache Offline
ST&T Secret Police
 
Join Date: Jun 2004
Location: UK
Posts: 616
Quote:
Originally Posted by Cyhaxor
ok guys i create a del.bat file and put it in C:\Documents and Settings\user\Desktop\BAT\ then i wrote the folowing script

cd..
cd..
cd..
cd..
del *.tmp /s

a cmd window open for 2-3secs and after finish its closed automatic... how i can keep this window open till i close it manual?

You could add "pause" and "EXIT", and if you wanted it to look a bit nicer and not show the commands you could use "@ECHO OFF" and "ECHO" for any text you do want to show, also "ECHO." will make a line break.

example:

@ECHO OFF
ECHO.
ECHO Deleting TMP files. Please wait...
ECHO.
ECHO.

cd..
cd..
cd..
cd..
del *.tmp /s

ECHO.
pause
EXIT

Also, why not use the full path to the files you want to delete, instead of using "cd.. cd.. cd.. cd..", use "cd C:\WINDOWS".

example:

@ECHO OFF
ECHO.
ECHO Deleting TMP files. Please wait...
ECHO.
ECHO.

cd C:\WINDOWS

del *.tmp /s

ECHO.
pause
EXIT

Last edited by cache : 03-28-2005 at 07:19 PM.
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Prompt Problem linolium Windows XP 2 03-28-2005 02:01 AM
command line geotdw Windows NT/2000/2003 2 10-15-2004 07:44 PM
command prompt errors!!!! chronick Windows XP 7 08-11-2004 12:18 AM
Question on DOS command to lookup an IP Gator Internet 2 06-18-2004 06:24 PM
Command prompt issue... Skusting Windows XP 1 03-19-2003 12:22 PM



All times are GMT -5. The time now is 08:56 AM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.