Discussion:
Shell("C:\WinNT\System32\cmd.exe.......
(too old to reply)
Al
2004-02-02 17:10:29 UTC
Permalink
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
Jonathan West
2004-02-02 17:28:36 UTC
Permalink
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.
--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
Post by 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\*.*
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
Loading...