Sign in with
Sign up | Sign in
Your question

Batch file to log in using static IP with u.name and password

Last response: in Windows 7
Share
January 21, 2013 12:18:47 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 server 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,

Currently I am using below script for one of my domain machine.


robocopy "D:\Program Files\Replicon Inc\Web TimeSheet\Database Backup\Web TimeSheet" "\\winserver\appbackup\replicon" /E /r:5 /purge /MAXAGE:3
cmd -


What modification I can do in this script for static ip log in?

More about : batch file log static password

a b $ Windows 7
January 21, 2013 2:08:27 PM

Sounds dodgy, but I'll give you the benefit of the doubt and give it a go.

Username and password - is there some reason you cannot add this workstation and user to your domain?
IP address - why is it static? You're better to set it to dynamic so that the DHCP server can assign it an IP address within the range that it's operating, a static IP address won't work if it's not in the same range as the rest of your network.

As to whether you can carry out an autologon with Robocopy - I haven't the faintest.
m
0
l
January 21, 2013 2:13:34 PM

pauls3743 said:
Sounds dodgy, but I'll give you the benefit of the doubt and give it a go.

Username and password - is there some reason you cannot add this workstation and user to your domain?
IP address - why is it static? You're better to set it to dynamic so that the DHCP server can assign it an IP address within the range that it's operating, a static IP address won't work if it's not in the same range as the rest of your network.

As to whether you can carry out an autologon with Robocopy - I haven't the faintest.



Well , This server is our voicemail server,

and If I add this to domain, it might crash server, also our vender has Access to that server, which I do not want them to see our other servers in domain, also they have administrative rights on this server, which require cause if they would like to make any changes or update,

Username and password, we have to access that server, so if I run script, I can mention that in to script and with that username and password I can get log in,

Static IP, cause, that we can log in from ,,

anyway,

I have to get this as it is,.. can not change it

is there any script I can use it?

please advise,
m
0
l
Related resources
Can't find your answer ? Ask !
a c 372 $ Windows 7
January 22, 2013 4:45:38 PM

The static IP does not matter, if you don't care that the password is in plain text (which it will have to be to do this), just map a drive first with the batch file with the "net use" command, it will allow you to specify a username and password for the serve share. Then copy the files to that share, and un-map the drive with "net use /delete" command. You can do this in reverse if the computer has a share you want to map to and copy the files from, or map it to the C$ share on the computer and you can copy from any directory that way. You just need to know the local account on the vendor computer.
m
0
l
January 22, 2013 4:55:13 PM

Hello,

This is my code as below
but this code is keep mapping drive directly in to "My computer"

any suggestion?
rem ***********************************************************************************************
rem Robocopy Server Data

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


net use \\ipaddress of source PC\backup /user:username password

robocopy \\ipaddress of source pc\backup c:\vmbackup / /S /SEC /V /NDL /NP /NFL /LOG:"c:\log.txt" /R:1 /W:1


net use /delete

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

cmd -
m
0
l
a c 372 $ Windows 7
January 29, 2013 11:48:09 AM

If that is your exact script, you are missing the drive letter you map to. In the robocopy command, you don't need to relist the ip, just use the drive letter you mapped the drive to. Not sure about what you mean about mapping a drive into My Computer. Of course if you map a drive it will show up in My Computer, that's why you have the second command to un-map it. You also need the drive letter there.

priyank_help said:
Hello,

This is my code as below
but this code is keep mapping drive directly in to "My computer"

any suggestion?
rem ***********************************************************************************************
rem Robocopy Server Data

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


net use \\ipaddress of source PC\backup /user:username password

robocopy \\ipaddress of source pc\backup c:\vmbackup / /S /SEC /V /NDL /NP /NFL /LOG:"c:\log.txt" /R:1 /W:1


net use /delete

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

cmd -

m
0
l
!