Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not VBA but DOS Batch File Question

Status
Not open for further replies.

jabrony76

Technical User
Apr 23, 2001
125
0
0
US
Hi all -

This is sort of Access related but mostly not...

In my current configuration, an end user clicks a batch file on their desktop that replaces a users front end on their C: Drive with a master front end on a network drive and then launch the application. (this allows for live updates and automatic upgrades)

Problem is, When the Batch file is done running and Access Opens, the batch file stays open in the background until the user manually closes it or the database is closed.

Any thoughts on how to code this differently or where my bug is happening? Its on a Windows 2000 system running Office 2000.

Heres the DOS Batch Code I'm using:
[red]
cd "S:\CCDBv3.0"
S:
del C:\CCDB\CCDB_v3.0\CCDB_v3.0.mdb
copy Front_End\CCDB_v3.0.MDB C:\CCDB\CCDB_v3.0 /Y
C:\CCDB\CCDB_v3.0\CCDB_v3.0.mdb

Exit
cls
[/red]

Thanks for any help you might be able to provide.

Andy
 
hmm... try some thing like this...

It will varry depending on the vertion of office/access but should work for you...


cd "S:\CCDBv3.0"
S:
del C:\CCDB\CCDB_v3.0\CCDB_v3.0.mdb
copy Front_End\CCDB_v3.0.MDB C:\CCDB\CCDB_v3.0 /Y
call "c:\program files\office\access.exe" "C:\CCDB\CCDB_v3.0\CCDB_v3.0.mdb"




if may even work just calling the mdb, but i don't know...

as you had it, the batch file waits for the program you ran to finish, using call tell's the batch file not to wait, just make the call and move on...

no need for an exit or cls command as when the batch file is done, it should just exit out... if it doesn't right click on it and check the settnigs... i'm sure there's a setting to exit when it's done doing any thing...


--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
No Problem! :)

I tried this with windows 2000 and it didn't work but what I've done with 98 is right click the batch file, go to properties. Go to the Program tab and, at the bottom left of the screen click on CLOSE ON EXIT (or something like that). This forces the dos window to close after done executing.

Good luck,
Jim


 
Jim,

I just put a couple pages up on my website about the batch files I use. One thing I recommend is having the batch file that odes the work sit on the server and just a shortcut that points to that batch file on the user's PC. That way if you need to change the startup routine, you can do that without having to touch the desktops.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Jeremy, You are the man, I do the same thing:)

I think you are my Idol...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Thanks for the responses all... but...

I tried doing it the way James suggested using "Call" and the DOS window still won't close behind the database until it closes.

I've also tried to Right Click on the raw Bat file and the DOS Window with the Bat file running and change the settings but I don't see any setting that says "Close on Exit". I'm running Windows 2000 with Office 2000.

Also, the Bat file is on the network with a shortcut that points to it.

Any other thoughts? If not, thanks for the suggestions already given!
Andy
 
ok, this is exacly how I do it... (I changed the file names and directory path's though)

I made a shortcut to the database that uses the security .mdw and store it with the database in the shared directory...

this is the line i use to run that shortcut...

start \\server12\database\contact.lnk
...

Hope this works for you...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top