?
Solved

Accessing remote %systemroot% using UNC

Posted on 2004-11-10
3
Medium Priority
?
547 Views
Last Modified: 2012-08-13
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\system32\logfile.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\logfile.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!
0
Comment
Question by:YEvans
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
scampgb earned 2000 total points
ID: 12547402
Hi YEvans,

Try \\hostname\admin$

This should point to the systemroot directory :-)
0
 

Author Comment

by:YEvans
ID: 12547642
Man I should have known that! I have gotten so used to just using the C$ and D$ admins shares I forgot all about the admin$ share.

Thanks!
0
 
LVL 15

Expert Comment

by:scampgb
ID: 12547651
*grin*

Glad I could help :)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question