Hi
In Windows PE/RE of Windows 10 v1704 (DOS command prompt), what is the procedure to find the shared folders on the network and how do I map them?
Thanks
Bye
Mapping the shared folders
Moderator: DosItHelp
Re: Mapping the shared folders
Most likely NET USE (execute NET HELP USE to get help).
E.g.to disconnect if the drive X: was still connected (option /yes is not documented, it forces silent disconnection).
to connect drive X: where "servername" can also be an IP address. If "share" contains a drive letter on the server then replace the colon with a Dollar sign (e.g. C$ instead of C:).
Steffen
E.g.
Code: Select all
net use X: /delete /yes
Code: Select all
net use X: "\\servername\share" /persistent:no
Steffen
Re: Mapping the shared folders
If you're worried about drive letters, use this piece of code to find an available one:
Code: Select all
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%D IN ( b d e f g h i j k l m n o p q r s t u v w x y z ) DO (
IF NOT EXIST %%D:\ (
SET MD=%%D
NET USE !MD!: "%DRIVE1%" /USER:%CREDS%
GOTO BREAK
)
)
:BREAK
:: Put code here to be acted on related to the recently mapped drive
NET USE %MD%: /delete
Re: Mapping the shared folders
SIMMS7400 wrote:If you're worried about drive letters, use this piece of code to find an available one:
<SNIP />
If you type an asterisk, *, instead of a drive letter it will assign the next available drive letter.
Code: Select all
NET USE *