Open directory in LAN ?
-
i have a task to open a directory on another pc in the LAN ,this directory is shared with password,and i dont want to display dialogue for user to click . i dont know how to do this ,anybody help me? thanks in advance.
NET USE \\hostname\sharename password Tack on /PERSISTENT:YES if you want it to be a lasting connection. At a command prompt, type NET USE /? for a list of other options.
-
NET USE \\hostname\sharename password Tack on /PERSISTENT:YES if you want it to be a lasting connection. At a command prompt, type NET USE /? for a list of other options.
-
thank you. can i place this command in my program code? and is there any WindowsAPI which can do this?
I don't know about the Windows API - I've just begun playing with it, but this command can be put into a batch file and run from the startup folder. I used to use a variation of the NET command this way to sync all my client PCs to the same time using the server's current time setting. One drawback is that it can leave a Command Prompt window open on completion. Adding a second command to the batch file of EXIT should close the DOS window.