Shell("C:\WinNT\System32\cmd.exe.......

A

Al

Hi Folks,

I wanted to distribute some code to another server where users can then run
a batch file to get macro templates off their workgroup server.

Before I can do this I have to connect to other servers with (for example);

NET USE I: \\SERVERSALES\SALESSHARE\

Then I can run COPY \TEMPLATES\*.* I:\WHEREEVER\*.*

I noticed that if I run something like:

Shell("C:\WInNT\System32\cmd.exe /k NET USE I: \\SERVERSALES\SALESSHARE\")
Shell("C:\WInNT\System32\cmd.exe /k COPY \TEMPLATES\*.* I:\WHEREEVER\*.*")

It does not wait for the network drive to connect before running the next
line. This creates a problem!

I see that their are commands in word to do this which is probably the
better way. Will they pause execution until each command is completed?

TIA

-Al
 
J

Jonathan West

Hi Al,

Go to www.mvps.org/vb/. Click the Samples link, and scrioll down to
Shell32.zip. This file contains a module that allows you to do a Shell &
Wait command.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top