Delete command in a script..

  • Thread starter Thread starter Andre Laplume via AccessMonster.com
  • Start date Start date
A

Andre Laplume via AccessMonster.com

I know this is a bonehead question but since I have discovered I can write
and schedule little scripts do take care of annoying processes over night I
have been looking for some sort of on-line listing of commands I may
use...no luck though. This time I want to put a command in the .bat file
to delete a file. I would have thought it would be: 'delete filename' but
no luck...

Anyone willing to provide the command and parameters.....
 
"Andre Laplume via AccessMonster.com" <[email protected]>
wrote in message
I know this is a bonehead question but since I have discovered I can
write and schedule little scripts do take care of annoying processes
over night I have been looking for some sort of on-line listing of
commands I may use...no luck though. This time I want to put a
command in the .bat file to delete a file. I would have thought it
would be: 'delete filename' but no luck...

Anyone willing to provide the command and parameters.....

In a .bat file? So this isn't really an Access question at all -- that
makes it a bit boneheaded, all right. <g> Have you tried:

del filename.ext

? Note that, if "filename.ext" is not in the current directory, you
must specify the path to it as well.
 
Well it technically is in MSAccess now in a form's VBA...I want to get it
it out and schedule the delete. Anyway, when I click START RUN (as a test)
then type del C:\filename....it says: 'Windows can not find 'del'...error.
 
Ok, START RUN: 'cmd del filenm' fires up the black dialog box, the del is
not issued unless I then type it...not sure this is what I want. When I
zip files overnight I simply have a .bat with a wzzip command, I do not
invoke CMD anywhere.... I am looking for a similar way to issue the delete
command...thanks for your patience, I am out of my element!
 
Andre Laplume via AccessMonster.com said:
Well it technically is in MSAccess now in a form's VBA...I want to
get it it out and schedule the delete. Anyway, when I click START
RUN (as a test) then type del C:\filename....it says: 'Windows can
not find 'del'...error.

Using cmd.exe, you have to specify the command to be executed with the
/c command-line argument. But to test what you're trying to do, why not
create a .bat file containing the del command, then run that .bat file
using Start -> Run... ?

It works.
 
Back
Top