Action |
Connect, disconnect or list network connections.
Syntax |
USE LIST
USE <* | "device" | "resource"> /DELETE [/PERSISTENT]
USE ["device"] <"resource"> [/USER:user] [/PASSWORD:password] [/PERSISTENT]
Remarks |
Use USE "*" /DELETE to delete all current connections except those to a NETLOGON share and those to the drive or share from which KiXtart was started.
If a resource name contains non-alphanumeric characters (such as - or +), enclose the name in quotation marks.
On Windows NT or higher only, the /USER and /PASSWORD parameters enable overriding the security context of the current user.
Check the value of @ERROR to see if USE was successful (a value of 0 indicates success).
The "USE *" syntax enables you to redirect the first available drive to a resource. If redirection is successful, @RESULT will contain the driveletter of the redirected drive.
Examples |
USE E:
"\\SERVER\PUBLIC" /PERSISTENT
USE * /DELETE
USE E:
"\\SERVER\PUBLIC" /user:Yogi /password:Bear
USE E:
"\\SERVER\PUBLIC"
USE LPT1: "\\SERVER\LASER" /user:testlan\USER1
USE L: /
USE LIST
USE * @HOMESHR ; connect any drive to user's home share
IF @ERROR = 0
? "Connected "
+ @RESULT + " to home share…"
ENDIF
USE H: @HOMESHR ; connect to user's home share
IF @ERROR = 0
H: ;
CD
@HOMEDIR ; change directory to user's
home directory
ENDIF