Page 1 of 1

Ms Access and closing batch file after executing

Posted: 22 Jul 2010 11:08
by MansiMansi
Hi Folks,

I have Ms Access Application that call batch file
Shell "cmd /c ""C:\Program Files\lotmaker\manual_update.bat"",vbNormalFocus"
DoCmd.Quit to close current MS Access


while the batch it self
copy \\mansiserver\distribution\deploy\32bit2000.mdb "c:\program files\lotmaker"
copy \\mansiserver\distribution\deploy\prices.mda "c:\program files\lotmaker"
REM Re-Run lotmaker after get the new version
CD \
CD \"Program Files\lotmaker"
32bit2000.mdb
Exit

if I run the batch by itself, it will copy the files and run the latest version and close itself
but when i run it from the access , it will call the batch and it close the current access
batch will copy the files and run the latest Application but will not close itself.
cmd will stay open until i close it from X or close the access that opened recently

Any Help?

Thanks in Advance,
MM

Re: Ms Access and closing batch file after executing

Posted: 22 Jul 2010 12:17
by aGerman
Try to add a CALL command.

Code: Select all

Shell "cmd /c call ""C:\Program Files\lotmaker\manual_update.bat"",vbNormalFocus"

BTW Is it true that you have to write the final quot behind vbNormalFocus?
IMO:

Code: Select all

Shell "cmd /c call ""C:\Program Files\lotmaker\manual_update.bat""", vbNormalFocus


Regards
aGerman

Re: Ms Access and closing batch file after executing

Posted: 22 Jul 2010 17:58
by MansiMansi
thanks ,
I tried but still same,
any other suggestion

Thanks again
MM

Re: Ms Access and closing batch file after executing

Posted: 22 Jul 2010 18:34
by aGerman
Try

Code: Select all

start "" "32bit2000.mdb"

in your batch code.

Regards
aGerman

Re: Ms Access and closing batch file after executing

Posted: 23 Jul 2010 07:21
by MansiMansi
Thanks so much
It's working
:wink: