Copying files from local computer to a remote server which is not in Domain and with username and password?

Answered Copying files from local computer to a remote server which is not in Domain and with username and password?

  • Monday, January 21, 2013 7:58 PM
     
     
    "I have one workstation with static IP, Wants to create batch file to log in to this,using user name and password, copy back up files from that workstation to my desktop with batch file, please help

    I am currently using batch file for back up for domain servers with robocopy commands in batch file  but one of the workstation is not in domain and has static ip , also it has username and password,

    Wants to create batch file on my desktop to log in this server---with username and password,, copy files from particular folder and paste it on my desktop in particular folder or auto create that folder,

    please help, "

    P Dave

All Replies

  • Monday, January 21, 2013 8:04 PM
    Moderator
     
     

    Hi,

    Don't forget to ask your question.

    Bill

  • Monday, January 21, 2013 8:06 PM
     
     

    Hello Bill,

    Question is already asked...

    Would you like to know more details?


    P Dave

  • Monday, January 21, 2013 9:13 PM
     
     

    Hello Bill,

    Question is already asked...

    Would you like to know more details?


    P Dave


    Hello Bill,

    Question is already asked...

    Would you like to know more details?


    P Dave

    We have to guess at the exact question.  Perhaps you want to as 'How can I authenticate on a remote workstation in a different domain?"

    RoboCopy cannot do this.  You can, however, map a drive with credentials to the remote machine and use that to authenticate or run RoboCopy against.

    net use \\server\share /user:domain\username

    You will be prompted for the password.

    You can proxy in by creating an account on the remote system with teh identical name and password as the account being used to do the copy.  This new account will need to have read permision on the files to be copied.

     

     


    ¯\_(ツ)_/¯

  • Monday, January 21, 2013 9:50 PM
     
     

    I am sorry but if you do not understand the instructions then you really need to learn the basics of Windows. 

    You can start by leaning how to use the built-in help.

    NET USE /?


    ¯\_(ツ)_/¯

  • Tuesday, January 22, 2013 1:29 PM
     
     

    Okay,

    I have figure out how to use net use command,

    here is my code, but I am getting "error 85-- local device already in use"

    What changes I should make in below script? to Avoid this error?

    rem ***********************************************************************************************
    rem Robocopy Server Data
    rem ***********************************************************************************************
    net use l: \\ipaddress of source pc\backup /user:username password
    robocopy "l:"  c:\vmbackup / /S /SEC /V  /NDL /NP /NFL /LOG:"c:\log.txt" /R:1 /W:1
    rem ***********************************************************************************************
    cmd -


    P Dave

  • Tuesday, January 22, 2013 3:50 PM
    Moderator
     
     Answered Has Code
    here is my code, but I am getting "error 85-- local device already in use"

    That error means that the local device name (the drive letter you are attempting to map) is already in use.

    You can get around the problem by avoiding mapping a drive and use the UNC path of the remote computer instead:


    net use \\a.b.c.d\IPC$ /user:username password
    robocopy \\a.b.c.d\backup c:\vmbackup ...
    

    Bill

  • Tuesday, January 22, 2013 4:50 PM
     
     

    Hello Bill,

    This one will create whole new drive in to my PC, I do not want to do that,I want scrip which I can run from any machine and take a back on that particular machine, by just changing destination folder,

    now how could I do that? by doing modification in this script?


    P Dave

  • Tuesday, January 22, 2013 4:58 PM
    Moderator
     
     

    Hi,

    My previous response explains how you do not need to map a drive.

    Bill

  • Tuesday, January 22, 2013 5:03 PM
     
     

    Hello Bill,

    This one will create whole new drive in to my PC, I do not want to do that,I want scrip which I can run from any machine and take a back on that particular machine, by just changing destination folder,

    now how could I do that? by doing modification in this script?


    P Dave


    You cannot access a remote machine unless you have an account on that machine.  If you do not have an account then you need to "attach" to it in some way.  NET USE does not create a drive.  It temprrarily connects a share or a drive to a share.

    I recommend that you learn the basics of Windows.  These things are very fundamental ot an understanding of how to use Windows.


    ¯\_(ツ)_/¯

  • Tuesday, January 22, 2013 5:07 PM
     
     

    Dear Jrv,

    All you can do is moaning about I need to learn windows basic and bla bla bla...

    I think you should stay out of this conversation, if you can not help in any way

    firstly you are not reading my code,

    2ndly you your self do not know basics of windows,

    So please do not post your next comment on this conversation,

    Thank you for your non valuable efforts...


    P Dave

  • Tuesday, January 22, 2013 5:20 PM
     
     

    Dear Jrv,

    All you can do is moaning about I need to learn windows basic and bla bla bla...

    I think you should stay out of this conversation, if you can not help in any way

    firstly you are not reading my code,

    2ndly you your self do not know basics of windows,

    So please do not post your next comment on this conversation,

    Thank you for your non valuable efforts...


    P Dave


    Dave - the question you are asking is so fundamental that it sows you need a better understanding of how to use WIndows.  Bil and I both answered your question and you are arguing with both of us.

    NO DRIVE IS BEING CREATED

    If you would study the basics you would be able to understand the answers better.

    I am jsut suggesting that this would be of help.


    ¯\_(ツ)_/¯

  • Tuesday, January 22, 2013 5:31 PM
     
     

    JRV,

    I can understand that, 1stly I am not a scripting guy, I know very very basic of this,

    2ndly, I need help , I am not asking anyone here to write code for me, I have already wrote that but its not doing which its suppose to do,

    check below screen shot, after running suggested script, it has mapped drive ,

    now I do not want to do that, I want just files to copy from that machine to my machine, and want script which I can run from any PC,

    Tried with UNC PATH as well, but not making any difference, its keep mapping that server drive to my computer


    P Dave


    • Edited by PD_asking Tuesday, January 22, 2013 5:35 PM s.shot
    •  
  • Tuesday, January 22, 2013 7:30 PM
    Moderator
     
     Answered Has Code

    Hi,

    Again: You don't have to map a drive. I already posted something that should work for you:


    net use \\a.b.c.d\IPC$ /user:username password
    robocopy \\a.b.c.d\backup c:\vmbackup ...
    

    Bill

    • Marked As Answer by PD_asking Wednesday, January 23, 2013 4:44 PM
    •  
  • Tuesday, January 22, 2013 7:41 PM
     
     

    Hello Bill,

    I have exactly modified my script as you suggested but still no difference, I have put whole script here, just for your reference,

    Error I am getting is

    "Error : Invalid Parameter #3 : "/"

    rem ***********************************************************************************************
    rem Robocopy Server Data

    rem ***********************************************************************************************

    net use \\<source SERVER NAME>\IPC$ /user:username password

    robocopy  \\<source SERVER NAME>\backup c:\vmbackup / /S /SEC /V  /NDL /NP /NFL /LOG:"c:\log.txt" /R:1 /W:1

    net use /delete

    rem ***********************************************************************************************

    cmd -


    P Dave

  • Tuesday, January 22, 2013 7:51 PM
     
     

    JRV,

    I can understand that, 1stly I am not a scripting guy, I know very very basic of this,

    2ndly, I need help , I am not asking anyone here to write code for me, I have already wrote that but its not doing which its suppose to do,

    check below screen shot, after running suggested script, it has mapped drive ,

    now I do not want to do that, I want just files to copy from that machine to my machine, and want script which I can run from any PC,

    Tried with UNC PATH as well, but not making any difference, its keep mapping that server drive to my computer


    P Dave



    JRV,

    I can understand that, 1stly I am not a scripting guy, I know very very basic of this,

    2ndly, I need help , I am not asking anyone here to write code for me, I have already wrote that but its not doing which its suppose to do,

    check below screen shot, after running suggested script, it has mapped drive ,

    now I do not want to do that, I want just files to copy from that machine to my machine, and want script which I can run from any PC,

    Tried with UNC PATH as well, but not making any difference, its keep mapping that server drive to my computer


    P Dave


    Bill - he still sees that "connection" although it isn't mapped it is attached temporarily.

    P - Log off and log back on and the attached connection will be gone.  It is temporary.   Again - knowing the basics of WIndows would let you know this.

    We have given you all of the answers that are possible.  There is no other way unless you have installed things like PowerShell and PowerShell remoting or an FTP server.

    If you do use a drive it can be just as easily deleted after you have finished the copy.

    Again: "NET USE /?" will tell you all of the options.

    Saying you know nothing is not an excuse for not thinking or looking more deeply into the suggestions made by those trying to help you.  This is not a MIcrosoft support forum or help desk.  It is a forum for admiinistrative scripting and assumes that those coming here are technically trained or experienced in the basics of Windows technology.

     


    ¯\_(ツ)_/¯

  • Tuesday, January 22, 2013 7:53 PM
     
     

    Thank you Bill and JRV,

    I will try your given suggestion,

    I will update you sooner I can,

    thanks


    P Dave

  • Tuesday, January 22, 2013 7:55 PM
     
     Answered

    Hello Bill,

    I have exactly modified my script as you suggested but still no difference, I have put whole script here, just for your reference,

    Error I am getting is

    "Error : Invalid Parameter #3 : "/"

    rem ***********************************************************************************************
    rem Robocopy Server Data

    rem ***********************************************************************************************

    net use \\<source SERVER NAME>\IPC$ /user:username password

    robocopy  \\<source SERVER NAME>\backup c:\vmbackup / /S /SEC /V  /NDL /NP /NFL /LOG:"c:\log.txt" /R:1 /W:1

    net use /delete

    rem ***********************************************************************************************

    cmd -


    P Dave

    YOu have a dopuble // in the command  after c:\vmbackup / /S /SEC


    ¯\_(ツ)_/¯

  • Tuesday, January 22, 2013 8:00 PM
     
     

    ITs Works!!

    JRV,

    That was actual problem, I detected just now,, you are rite, I have double // in that command,

    Thanks for your all support,

    JRV, -- Sorry for my uncouth behavior earlier ,,nothing personal.. it was just too many things at same time,

    Thanks Bill and JRV, I appreciate your help on this,

    Regards,


    P Dave

  • Tuesday, January 22, 2013 8:07 PM
     
     

    ITs Works!!

    JRV,

    That was actual problem, I detected just now,, you are rite, I have double // in that command,

    Thanks for your all support,

    JRV, -- Sorry for my uncouth behavior earlier ,,nothing personal.. it was just too many things at same time,

    Thanks Bill and JRV, I appreciate your help on this,

    Regards,


    P Dave

    Great - glad you got it.

    It was harder to get you to see the light at the end of the tunnel becuse you do not know the basics.,  The basics are easy toi learn.  Ther eare many books that will show you how WIndows is wired to gether and explain why. Things like cross system authentication and mapping of dirves and setting up workgroup level accounts that can be used to avoid this drive mapping.  All of this is fundamental to WIndows since Winows 1.0 and even back as far as DOS 2.0.  Without a good understanding of these things it is very hard to know what questions to ask and how to view the answers.

    I made/make the suggestion because it will save you a lot of frustration down the road.  Almost everything in WIndows is based on this underlying architecture.

    Good Luck


    ¯\_(ツ)_/¯