It's been a while since I did DOS batches and I'm at work on NT so I
can't test but I think the reason it doesn't close is because "echo" is
still "on". Before "Exit" put an echo off command:
@echo off
Or even this might do without needing EXIT:
@echo off
cls
The NET USE command does the same thing as SUBST but it is less prone to
errors and problems. It's well known that the subst command has a
troubled history and it is generally accepted as better practice to use
the NET USE command on Windows instead of subst. The syntax is similar,
basically in your case:
NET USE [driveletter:] \\ComputerName\ShareName\folder1\folder2
The full syntax is:
net use [{DeviceName | *}] [{\\ComputerName[\ShareName[\Volume]]]
|[
http://ComputerName/ShareName[/Folder]}] [{Password | *}]]
[/user:[DomainName\]UserName] [/user:[DottedDomainName\]UserName]
[/user: [UserName@DottedDomainName] [/savecred] [/smartcard] [{/delete |
/persistent:{yes | no}}]
http://www.microsoft.com/technet/pro...620600035.mspx
To get help on the command do: net help or net /? or net use /? or
net use /? | more at a command prompt.
The net use command is a sub command of the powerfull net command.
John
Stephen Ford wrote:
It might help if you post the contents of the batch file here so we can
have a look at the syntax.
echo on
subst H: F:\
subst J: F:\data
subst K: "F:\DATA\Acquire Home Services"
subst L: F:\DATA\Paradox
subst M: "F:\DATA\WP9 App data"
subst N: "C:\WINDOWS\Application Data\Corel\PerfectExpert\9\Custom WP
Templates"
EXIT
What are you trying to do?
Create a set of dirve letters which are common to all my PCs. This enables
the use of the same s/w configuration. The PCs are in a workgroup. One
shares its data and acts like a server. The others map drives to that shared
data. The "server" run WIN98SE and can't map a drive to itself (win98
limitation) so I use subst.
Why? It's the only way I know.
It's usually best not to use the SUBST command on Windows, try the NET (net
use) command instead.
Any suggested command formats?
Stephen