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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run a dos command from Access modules 1

Status
Not open for further replies.

ak77bd

Programmer
May 9, 2008
4
US
Hi

I need to copy a file from one location to another from Access. Its an mdb file and users some time will need to have the latest mdb file which will be downloaded from the server when they click a button.

now I used to have a copy file code which would copy the file block by block. But now the server has moved to a far away location from the users and that code gets hanged from some reason...

So i was trying to do a simple dos command copy

Here is my code that I am trying to run when they click the button

Call Shell(Environ$("COMSPEC") & " /c C:\copy /Y/V T:\BG_Building_Data.mdb C:\BGSolutions\BG_Building_Data.mdb", vbNormalFocus)

But it doesn't work. command prompt opens up and closes very quickly for me to see anything. can some one tell me how to put "PAUSE" in that line of code so that i can see whats going on. Or if some one have a better code to run a copy command please let me know.

Thanks a bunch in advance...
 
>can some one tell me how to put "PAUSE" in that line of code so that i can see whats going on.

>Call Shell(Environ$("COMSPEC") & " /c C:\copy /Y/V T:\BG_Building_Data.mdb C:\BGSolutions\BG_Building_Data.mdb", vbNormalFocus)
[tt]Call Shell(Environ$("COMSPEC") & " /[red]k[/red] C:\copy /Y/V T:\BG_Building_Data.mdb C:\BGSolutions\BG_Building_Data.mdb", vbNormalFocus)
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top