Deleting a file using a ms-dos batch file

Joined
May 17, 2005
Messages
105
Reaction score
0
Hi.
I am trying to develop a barcoding system at the moment.
The operating system I am using is XP.
Everytime I place the scanner into the cradle, it downloads a file in the following link:

c:\Documents and Settings\Aaron\Desktop\Barcode Data Files\Scanned Finished Goods.csv

What I am trying to do is download the data into Access, which I have done, but using an access macro I want to open an ms-dos application which will delete the original file, so that it can be generated again next time the handset goes in the cradle.

Can anyone help me?

Regards
AJ
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
in DOS, you would simply run :

del c:\Documents and Settings\Aaron\Desktop\Barcode Data Files\Scanned Finished Goods.csv

:)
 
Joined
May 17, 2005
Messages
105
Reaction score
0
That was my first attempt, but it kept saying that the path could not be found.
I made a file in C:\BDF\SSCANNEDFINISHEDGOODS.CSV and this worked.
For some reason it doesn't like spaces in the string!
I could really do with this to work with the original string, otherwise I will have to get the programmer to amend the links, which will cost, no matter how simple it is.
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Ah, in that case, shorten each directory to 6 characters with a ~1 on the end.

i.e.:

c:\Docume~1\Aaron\Desktop\Barcod~1\Scanned Finished Goods.csv

or if it doesn't like the filename:

c:\Docume~1\Aaron\Desktop\Barcod~1\Scanned~1.csv
 
Joined
May 17, 2005
Messages
105
Reaction score
0
I managed to sort it last night before you replied.
The problem was it needed quotes because of the spaces.
It was trying to delete Scanned, then trying to delete Finished, then trying to delete Goods.csv.
The string I used was:

del "c:\documents and settings\aaron\desktop\barcode data files\scanned finished goods.csv"

This did the job.

Although, I now have another problem.
But I will try and resolve it on my own first.

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top