YEvans
asked on
Accessing remote %systemroot% using UNC
I want to copy a file to or from the %systemroot%\system32 directory on a mix of Windows 2000 and Wndows XP workstations. The systemroot of the Windows 2000 machines is C:\Winnt and the systemroot of the Windows XP machines is C:\Windows. I use a script that loops through a list of workstations, but the repeating command is, for example:
copy \\<hostname>\c$\winnt\syst em32\logfi le.txt
Obviously this will fail on the WIndows XP machines. I would like to use the systemroot variable, but when I try:
copy \\<hostname>\%systemroot%\ system32\l ogfile.txt
it fails because the variable is being resolved on my machine and comes out the wrong syntax anyway (\\<hostname>\c:\winnt...)
How can I use one command that will resolve the remote host's systemroot variable in the copy command? Or what alternatives do I have for accomplishing the same task?
Thanks!
copy \\<hostname>\c$\winnt\syst
Obviously this will fail on the WIndows XP machines. I would like to use the systemroot variable, but when I try:
copy \\<hostname>\%systemroot%\
it fails because the variable is being resolved on my machine and comes out the wrong syntax anyway (\\<hostname>\c:\winnt...)
How can I use one command that will resolve the remote host's systemroot variable in the copy command? Or what alternatives do I have for accomplishing the same task?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
*grin*
Glad I could help :)
Glad I could help :)
ASKER
Thanks!