Computing.Net > Forums > Windows XP > Batch File to Delete in XP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File to Delete in XP

Reply to Message Icon

Name: Pavesa
Date: February 17, 2008 at 16:27:25 Pacific
OS: Win XP Pro
CPU/Ram: Athlon 64 3500/1GB
Product: Home Made
Comment:

Hi,

I have a system that sends watchlists of share volatility data derived out of stock prices to users via email and I'm upgrading from Win2k to WinXP. It uses a program called automailer to send the watchlist data. It copies in the user's recipient email address and message into the "automailer" directory plus their watchlist as an html attachment into the "automailer/send" directory and then it fires up the program to send the message with the html watchlist attached. After each user, it deletes the recipient/message/watchlist attachment from the "automailer" and "automailer/send" directory and goes on to copy the data for the next user. I have a batch job to do the deleting as follows:

@echo Off
del c:\progra~1\automa~1\message.txt
del c:\progra~1\automa~1\Rcpts.csv
del c:\progra~1\automa~1\Send\FKI*.*
del c:\progra~1\automa~1\Send\Watch*.*
:exit

where progra~1 is the Program Files directory and automa~1 is the Automailer directory.

This worked fine in Win2KPro but doesn't seem to work under XPPro. I think XP uses full directory names so I changed it to

@echo Off
del c:\Program Files\AutoMailer XL\message.txt
del c:\Program Files\AutoMailer XL\Rcpts.csv
del c:\Program Files\AutoMailer XL\Send\Watch*.*
:exit

but it still doesn't work. Can anyone tell me what is the problem here. I seem to have run out of ideas..

Thanks

Pavesa



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: February 17, 2008 at 17:09:54 Pacific
Reply:

If you are using long file names try enclosing the path in double quotes. Other wise the space before XL is interpreted as a delimiter.

del "c:\Program Files\AutoMailer XL\message.txt"


Stuart


0

Response Number 2
Name: Pavesa
Date: February 17, 2008 at 17:56:07 Pacific
Reply:

Hi Stuart

I just tried that and it seems partly to work.The explicitly addressed files are fine, but the wildcards don't seem to work

del "c:\progra~1\automa~1\message.txt"
del "c:\progra~1\automa~1\Rcpts.csv"

are deleted, but

del c:\progra~1\automa~1\Send\FKI*.*
del c:\progra~1\automa~1\Send\Watch*.*

are not. Is there any particular format for using wildcards in XP?

Thanks

Pavesa


0

Response Number 3
Name: Mechanix2Go
Date: February 18, 2008 at 01:42:10 Pacific
Reply:

Stuart is right, as usual.

2K & XP both CAN use the truncated 8.3 names, but both are inconsistent in their handling.

To be safe use LFNs with quotes:


del "c:\Program Files\AutoMailer XL\*.ext"


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 4
Name: Pavesa
Date: February 18, 2008 at 08:22:03 Pacific
Reply:

Hi Stuart and Mechanix2Go

Yes, I used the extension and it now works fine. Looks like MS decided *.* was sufficiently bad form that they've put a blanket prohibition.. what an illiberal world XP is!

thanks for the help

Pavesa


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Won't install the 2 new .... Format of the file System...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Batch File to Delete in XP

Batch file to delete by date www.computing.net/answers/windows-xp/batch-file-to-delete-by-date-/135330.html

Batch file to delete files +60 days www.computing.net/answers/windows-xp/batch-file-to-delete-files-60-days/149698.html

Batch file to clear internet files www.computing.net/answers/windows-xp/batch-file-to-clear-internet-files/43849.html