Access Network share without mapping


  1. Posts : 11
    Win 7 Ultimate
       #1

    Access Network share without mapping


    I want to know if I can access a network share (for CMD line copy) that requires a username and password without mapping it.

    The reason is for the purpose of copying backups. If I were to map the drive, any virus/malware could infect the share, defeating the purpose.

    I know I can copy to the share if use the same account/passwords on both machines and just do xcopy \\pcname\\sharename\..... I was hoping to avoid creating/changing accounts on the machines.

    I know I can map the drive using netuse and then kill it after the copy. This isn't perfect, but I guess if there is no other way, it will pass.
      My Computer


  2. Posts : 784
    Linux Mint 17 Cinnamon | Win 7 Ult x64
       #2

    Hi,

    I'm going to assume you want this to be automated, so you can do this mklink and fsutil commands. Create a task in task scheduler to run the following script.


    @Echo Off
    Rem MoveBackup.cmd
    C:
    CD\

    Rem Allow following of symlink..
    fsutil behaviour set symlinkevaluation L2R:1

    Rem Establish the link
    mklink /d backup \\machinename\sharename

    CD backup
    xcopy /s/e <backupsource> .
    CD\
    RD Test1

    Rem Disallow following of symlink
    fsutil behaviour set symlinkevaluation L2R:0

    Notes:
    By default symlink evaluation is off. L2R means Local 2 Remote. 1 is on, 0 is off

    \\machinename\sharename must be discoverable and a share must have been previously created otherwise the mklink will create the link ok, but you will not be able to access the remote folder (network name not found).

    If a machine and share are discoverable, then technically, they might be open to potential virus exploits anyway.

    c:\backup must not exist when attempting to crate the link. mklink will complain "Cannot create a file when that file already exists"

    There are 4 combinations of symlink evaluation: L2L, L2R, R2R and R2L. By default they are all off, as most people don't use symlinks and junctions. But you can turn them on and leave them on. The fsutil at the end of the above script is only needed if you are concerned about something attempting to establish a link to a remote share; Possible but unlikely.

    <backupsource> is the location of your backup files that you want to place on the remote location. The dot after <backupsource> means "Here" and is optional. If omitted it is implied.

    Deleting the symlink does not delete the contents of the remote location.

    hth
    Tanya
      My Computer


  3. Posts : 11
    Win 7 Ultimate
    Thread Starter
       #3

    I don't see how this would work as there is no user/pwd and the share is not accessible without it.
      My Computer


  4. Posts : 2,913
    Windows 7 Ultimate x64 SP1
       #4
      My Computer


  5. Posts : 784
    Linux Mint 17 Cinnamon | Win 7 Ult x64
       #5

    Sorry, my bad.

    I forget that my computer logs in to my remote machine at boot time, and I never have to provide the credentials because the connection is persistent.

    I used a combination of credential managerment in contol panel and the netplwiz applet to accomplish this. From that point on, I never have to supply credentials to log in to the remote machine as I have already been authenticated at boot time.

    Credentials manager, if you are not familiar with it, allows yet to set a login and password to a remote machine, or remote network location.

    netplwiz allows you to by pass the login screen at boot time if there are multiple users on your machine. You can always log off, and swap users.

    If you are required to provide credentials everytime you connect to the remote machine, then yes, I think you are right. You are going to have to use net use.
      My Computer


  6. Posts : 11
    Win 7 Ultimate
    Thread Starter
       #6

    kegobeer said:
    If you read even the title or first sentence, it says without mapping a drive. I am not sure why people respond without even reading the question.
      My Computer


  7. Posts : 784
    Linux Mint 17 Cinnamon | Win 7 Ult x64
       #7

    michaeljc70 said:
    If you read even the title or first sentence, it says without mapping a drive. I am not sure why people respond without even reading the question.
    I suspect it's because of the good nature of volunteers who do their best to help people. Sometimes people misread things, it doesn't diminish their desire to try and help a fellow person with a problem.

    The solution I provided will work. If you create a persistent connection, and it will do it without having to map a drive. But I do understand if you have concerns about using persistent connections.

    Also, I beleive that using task scheduler and running under and account that exists on both machines will also work, as long as the username and password on both machines are the same. (This is where one might use the netplwiz applet).

    And of course, you always have third party backup suftware like Acronis, COmodo, Macrium and others that may accomplish the task.

    I wish I could be of more help.

    Edit justing thinking about this; Windows 7 backup will do this for you. Granted, Windows offering is not very good, but you can back up to a remote location; It asks for your credentials when you create the backup. There was not a lot of information in your original post with which to work. For example, you haven't said whether you want to do this attended or unatended, so I've just made assumptions.

    Tanya
      My Computer


  8. Posts : 11
    Win 7 Ultimate
    Thread Starter
       #8

    I appreciate any reasonable effort to help. But when you just post a link to something that doesn't answer the question, you've wasted your time and mine. It seems pretty widespread online. I've had people ask me 12 questions and then say they know nothing about the topic!

    I think as someone who asks a question, it is your responsibility to Google it and look for an answer on your own before posting. As a responder, it is your responsibility to read the question before posting. It is not a contest to respond to as many posts as you can regardless of if they are relevant or correct.
      My Computer


  9. Posts : 784
    Linux Mint 17 Cinnamon | Win 7 Ult x64
       #9

    michaeljc70 said:
    I appreciate any reasonable effort to help. But when you just post a link to something that doesn't answer the question, you've wasted your time and mine. It seems pretty widespread online. I've had people ask me 12 questions and then say they know nothing about the topic!

    I think as someone who asks a question, it is your responsibility to Google it and look for an answer on your own before posting. As a responder, it is your responsibility to read the question before posting. It is not a contest to respond to as many posts as you can regardless of if they are relevant or correct.
    Fair enough. I guess sometimes we just need to ignore the irrelevant posts without publicly embarrasing the responder.

    There was not alot of information provided in your original post about how you're doing the backup, and the solutions offered would be based on what information you did provide.

    I offered you 3 or 4 ways to accomplish the task. I have no way of knowing just how close to your needs they are because other than "copy without mapping" there is no more information to guide would-be responders.

    Anyway, I think it's all moot now.

    I wish you all the best in finding a solution that meets your needs.

    Tanya
      My Computer


  10. Posts : 11
    Win 7 Ultimate
    Thread Starter
       #10

    It sounds like if I put the credentials in Credential Manager, I can do the copy. If a virus were to look at network locations though, it would also have access to the share which is what I was trying to avoid.

    It seems like using the cmd line to map a drive, copy the backup, and then dropping the mapping is a better option. Yes, malware could get at that drive while mapped, but it would only be mapped for a short time.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:26.
Find Us