troubleshooting Question

Can I use computer name.domain instead of the IP address in the path in a cmd file?

Avatar of PDSWSS
PDSWSS asked on
Microsoft DOSStorage SoftwareWindows Server 2008
19 Comments1 Solution373 ViewsLast Modified:
I have set up a cmd file (attached) that backs up a folder from a local server to a remote server.

I will soon need to change the remote backup location.  The computer at the new location is set up with a dynamic IP and a fixed computer.domain name.   Will the code work if the IP address is replaced with the computer.domain name?

@echo off

:: variables
set drive=\\\Shared$\Backups\TEST
set folder=Test_%date:~10,4%_%date:~4,2%_%date:~7,2%
set backupcmd=xcopy/s/c/d/e/h/i/r/y

md "%drive%\%folder%"

@echo %backupcmd% "C:\shared$\Test1" "%drive%\%folder%"
%backupcmd% "C:\shared$\Test1" "%drive%\%folder%"

echo Backup Complete!

Open in new window

Chris Millard

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 19 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros