Re: del not working in .bat file



The file is not Read-Only, the file will be on the normal local C drive and the file can be deleted manually.
Maybe though the file is still in use by SQLite when the del command is called.
I don't know how the sequence of commands is in a .bat file.
Could it be that a command is called while the previous line is not finished yet?
Is there something like a wait or DoEvents in a .bat file?

I thought the way with WScript was an easy way to run the .bat file without showing the console.
Yes, maybe I should do away with the .bat file, but it works fine except on this one machine.
No, I am not running VBS, except for this one call.

RBS

"Bob Butler" <tiredofit@xxxxxxxxxxx> wrote in message news:uMqqf9NDHHA.2328@xxxxxxxxxxxxxxxxxxxxxxx
"RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message
news:O6W8GtNDHHA.348@xxxxxxxxxxxxxxxxxxxx
Have the following .bat file:

cd C:\RBSSynergyReporting\ReadCodes
del ReadCode.db
C:\RBSSynergyReporting\Program\SQLite3 ReadCode.db
<ReadCodeForSQLite.sql del ReadCodeForSQLite.sql

and this is called like this:

Dim oShell

Set oShell = CreateObject("WSCript.shell")
oShell.Run "cmd /C " & strBATFile, 0
Set oShell = Nothing
DoEvents

All this works fine, except on one machine the line: del
ReadCodeForSQLite.sql
doesn't delete the .sql file. I can't see that machine, so not sure
what is going on.
Any ideas what the trouble could be here?
The file is present and there are no permission problems. VBS is
present as well.

apart from this not being a VB question...
is the file read only?
is it possible that the working directory is currently on a drive other than
C:?
can you delete it manually?
why don't you eliminate the BAT file and control the steps directly from VB?

BTW, if this really is called from VB and not VBScript then you should lose
the WScript.Shell object and use VB's Shell function or one of the API calls
for starting an app. If it is VBScript then this is doubly the wrong group.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."


.



Relevant Pages

  • del not working in .bat file
    ... Have the following .bat file: ... del ReadCodeForSQLite.sql ... Dim oShell ... Set oShell = CreateObject ...
    (microsoft.public.vb.general.discussion)
  • Re: ie6sp1 : Repair Function Blocked - Anyone know of a fix?
    ... for command itself not to the thing it is being used to execute. ... then modifying it to do the call and append, then execute the bat file. ... Then edit dlls.bat to prefix each line with getvers and append>>versions.txt ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Need DTSRUN Utility to complete before proceeding
    ... > Also would like the bat file to fail if the DTSRUN utility fail, ... discerned at the command line prodessor. ... same when run in the scheduler as when they're run on the server under ... If you write a BAT file, ...
    (microsoft.public.sqlserver.dts)
  • Re: How do I...
    ... I initiated the BAT file from the Registry without any ... trying to get the "DOS CMD.EXE" window to either run ... >> file that contained the command worked. ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: VFP 6 - problem with RUN command
    ... I think you simply need to de-bug your .bat file. ... Toos VFP to the side for ... The PAUSE command, however, functions beautifully now. ... and a CALL command to another batch file doesn't work, ...
    (microsoft.public.fox.programmer.exchange)