PPRuNe Forums - View Single Post - intermittent home network
View Single Post
Old 17th Apr 2020, 20:16
  #2 (permalink)  
jimjim1
 
Join Date: Oct 2007
Location: Here
Posts: 963
Received 3 Likes on 2 Posts
Automagical stuff that microsoft thinks you don't need to understand often seems to go awry.

If I am using shared folders I just mount the share with the "net use" command.

net use drive-letter: \\computername\sharename

Of course you can run into permissions issues but I think it asks you for a userid and password if it wants one. You provide a userid and password from the "shared" side, not the machine you are trying to mount it on.

net use \\computername\sharename -- will choose a drive letter for you.

net use L: \\computername\sharename -- will mount the share as drive L:.

Now the trick is, if you disconnect for any reason and come back later it may or may not re-connect.

Check with

c: \>net use

Disconnected Z: \\fs1\PS Microsoft Windows Network

If it says Disconnected then I always just delete it and re mount it.

net use z: /delete
net use z: \\fs1\PS

Once you get the permissions sorted then the above works every time.

With shares you do need to be aware of security these days, for example it may be trivial for someone to mount YOUR share in a cafe if you are using their WiFi.

net use z: \\fs1\PS /PERSISTENT:YES

means it should remember it.

net view \\computername

will display all the shares IF you have permission.

I have left the sharing process out since you can easily find that on tinterwebs. net use is less commonly described but as I said, once set up (permissions) the above works EVERY TIME.

Finally there are pre-configured shares on every windows computer. c$ is the C drive. $ means that it is not displayed by the net use command, but EVERY windows computer has it pre-configured.

net use x: \\computername\c$

Once again the permissions may get tricky.

Finally to find the computername type the set command, the computername is displayed. They are in alphabetical order.

C: \Users\jim>set
ALLUSERSPROFILE=C: \ProgramData
CommonProgramFiles=C: \Program Files\Common Files
CommonProgramFiles(x86)=C: \Program Files (x86)\Common Files
CommonProgram=C: \Program Files\Common Files
COMPUTERNAME=MYCOMPUTER
ComSpec=C: \WINDOWS\system32\cmd.exe
. . .

If you like you can use

set | find "COMPUT" --- this is case sensitive

C: \Users\jim>set | find "OMPU"
COMPUTERNAME=MN137

C: \Users\jim>

Nothing above is case sensitive EXCEPT the bit in the quotes of the find command.

You can mix and match the GUI File Manager stuff and the above. The only thing that I am not sure how to do from the GUI is the /delete bit. This is needed though if a mounted share goes to the "Disconnected" state.

Finally, you can have mounted share without drive letters, I would guess that this may be what you get automagically.

If you get one like that that is disconnected you could try to delete it with net use and re-mount it from the GUI? Or just use the drive letter version??

I have one on my work computer now -

net use
Disconnected \\TMP01\Data Microsoft Windows Network

It doesn't seem a problem with my work computer but I don't deal with that part of it. We likely have login scripts that explicitly mount the drives with net use commands.

I just put \\TMP01\Data in the address bar in File Explorer and I get (re-)connected.



Last edited by jimjim1; 17th Apr 2020 at 20:37.
jimjim1 is offline