Ms Access and closing batch file after executing

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
MansiMansi
Posts: 3
Joined: 22 Jul 2010 10:57

Ms Access and closing batch file after executing

#1 Post by MansiMansi » 22 Jul 2010 11:08

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Ms Access and closing batch file after executing

#2 Post by aGerman » 22 Jul 2010 12:17

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

MansiMansi
Posts: 3
Joined: 22 Jul 2010 10:57

Re: Ms Access and closing batch file after executing

#3 Post by MansiMansi » 22 Jul 2010 17:58

thanks ,
I tried but still same,
any other suggestion

Thanks again
MM

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Ms Access and closing batch file after executing

#4 Post by aGerman » 22 Jul 2010 18:34

Try

Code: Select all

start "" "32bit2000.mdb"

in your batch code.

Regards
aGerman

MansiMansi
Posts: 3
Joined: 22 Jul 2010 10:57

Re: Ms Access and closing batch file after executing

#5 Post by MansiMansi » 23 Jul 2010 07:21

Thanks so much
It's working
:wink:

Post Reply