CDRInfo Forum CDRInfo Forum

Forums  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

Another Batch Command Question   Logged in as: Guest
Viewers: 477 You can click here to see Today's Posts | Most Active Topics | Posts Since Last Visit
  Printable Version
All Forums >> [Other] >> Free Discussion >> Another Batch Command Question Page: [1]
Login
Message << Older Topic   Newer Topic >>
Another Batch Command Question - 9/30/2008 11:00:46 PM   
killalot57


Posts: 206
Joined: 6/6/2007
From: Ava, NY
Status: offline
Hello, I'm making a batch command to delete all the files in my "recent files" folder. At first I set it up so that it would create a .txt file in there, then delete all the files in there, so that I wouldn't get an error message when I ran it. Here is what I had...

@echo off
echo.>"C:\Documents and Settings\James\Recent\"file.txt
del /q "C:\Documents and Settings\James\Recent\*.*"
ECHO Arg, I'm getting Tired Of Making These!
ECHO.
PAUSE

What I'd like to do is have a command that will only tell it to delete the files there is one exist. So I tried the following command line in a different batch command.

@echo off
if exist "C:\Documents and Settings\James\Recent\*.*" del /q "C:\Documents and Settings\James\Recent\*.*"
echo hi everyone
echo.
PAUSE

I get most of my command lines from friends "sithtracy" and random internet people, so I can't really figure out what to change myself. I tried a few variations but I haven't been getting anywhere...


< Message edited by killalot57 -- 9/30/2008 11:01:48 PM >
Post #: 1
RE: Another Batch Command Question - 10/18/2008 9:51:40 AM   
SithTracy


Posts: 1670
Status: offline
This is pretty easy to accomplish... it seems you have a ton of batch file questions in you so I am going to direct you to Google Groups (classically known as Usenet) - alt.msdos.batch.nt.  There is a wealth of knowledge out there for whatever you seek.  Just avoid the dumb questions like how to add a date/time stamp to a file name.  It is probably best to use the search function because what you are asking has been done a 1000 times over.

(in reply to killalot57)
Post #: 2
RE: Another Batch Command Question - 10/19/2008 3:49:52 AM   
killalot57


Posts: 206
Joined: 6/6/2007
From: Ava, NY
Status: offline
Well okay then, thanks

(in reply to SithTracy)
Post #: 3
Page:   [1]
All Forums >> [Other] >> Free Discussion >> Another Batch Command Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.031