Click to See Complete Forum and Search --> : [RESOLVED] batch: map network NET USE


vietboy505
March 1st, 2006, 10:28 AM
I wrote a batch script to mount the network automatic at startup. It doesn't allow to map as drive.
I used:

mount.bat

NET USE \\SERVER

Will output..
The command completed successfully.

Now I have a problem with that,
When I checked NET USE:

Disconnected \\SERVER\IPC$ Microsoft Windows Network
The command completed successfully.

It never connect at all, how can I make sure it's connect, and if it's disconnected.
Remap it.

PeejAvery
March 1st, 2006, 04:01 PM
Well, to use net use properly you must assign a drive before specifying the network location. Just check to see if that drive exists. If it does, then you are connected. If not, you are disconnected.

dglienna
March 1st, 2006, 07:46 PM
Here are the parameters:

The syntax of this command is:


NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]