Administrative Shares

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

Administrative Shares

Post by MigrationUser »

10 Jan 2008 20:33
drifty

I have been working with RoboCopy and noticed some of the batch files use the $ for the paths and some do not. I understand these are for administrative shares but I don't know why we should or should not use the $.

These are some examples of how they are used by some admins:

Net use command:
NET USE \\ABFFG-S1701\e$

Source path:
\\ABFFG-S1701\ACT_REPORTS$

Destination Path:
Z:\AB2318121\GS\ACT_REPORTS$

-Frank

----------------------------

#2 11 Jan 2008 15:04
Simon Sheppard


The dollar simply means the share is hidden

If you create a share and call it something like Mysharedfolder$ then it will not be visible when browsing network neighbourhood, but you can still use it if you know the name.

Most admins use hidden shares to hide things the users dont need to see, but be aware that it's security-by-obscurity i.e. it's not a replacement for setting appropriate file permissions and/or share permissions.

The default admin shares include this dollar so C: is shared as C$
Administrative shares also have default share permissions that restrict access to members of only a few security groups.

----------------------------

#3 11 Jan 2008 15:15
drifty


So if I wanted to make sure to copy everything on C:\ including hidden shares I should use C$ in my RoboCopy script instead of C:\ ? Does this also apply to a share such as \\Server\Share$ instead of \\Server\Share ?
-Frank

----------------------------

#4 11 Jan 2008 18:15
Simon Sheppard


Just use whatever name was defined when the share was setup

so if the share was called "HiddenShare$" access it as \\Server\HiddenShare$
if the share was called "Share" then access it as \\Server\Share

The default share name for C: is c$ but theres nothing stopping you from sharing C: as myCdrive or myCdrivehidden$

You can have more than one share for the same folder as long as the shares have different names, so it is possible to create two shares for the same folder, one hidden and one visible and they can each have different share permissions.

----------------------------

#5 11 Jan 2008 18:23
Simon Sheppard


One other thing, if you are running the script locally then the main difference between c: and \\machinename\sharename is that the latter will be subject to the permissions on the share.

If the share is set to only allow read-only then thats all you will get, even if your account has 'full control' of the individual files.

----------------------------

#6 11 Jan 2008 18:59
drifty


Thanks for the help.
-Frank

----------------------------

#7 11 Jan 2008 23:05
drifty


One more question:
I created a hidden folder on my XP machine under the temp directory C:\Temp\Hidden . Next I made up a Robocopy script and ran it to see if the hidden folder was copied - and it wasn't.
How would I modify this script to make sure any hidden folders were copied?

H:\AB561\Scripts\robocopy.exe /Job:"H:\AB561\Scripts\Filtered.rcj" "C:\temp" "H:\AB561\PC\Doe, Mary\C" /Log+:"H:\AB561\Logs\PC_Collection.txt"

-Frank

----------------------------

#8 14 Jan 2008 15:10
bluesxman


Tried the "/IA" switch?

cmd | *sh | ruby | chef

----------------------------

#9 14 Jan 2008 16:05
drifty


From what I understand the switch will allow only files with the attributes selected to be copied. I would like to collect all files and folders including hidden. I have not tried it though.
-Frank

----------------------------

#10 15 Jan 2008 16:49
bluesxman


Good point. So how about you just run the robocopy twice, once with the "/IA" switch and once without?

Having said that, I think that switch applies to hidden files only. In fact, when I just tried a simple "robocopy /s" on a directory containing a hidden and non-hidden directory it copied the lot without complaint.

cmd | *sh | ruby | chef

----------------------------

#11 29 Feb 2008 15:34
drifty


I use RoboCopy to collect files from various laptops using an external hard drive via USB.
The trpical application is to put the batch file and RoboCopy in a folder on the external drive, connect the drive to the laptop, edit the script if necessary and run it from the external drive. This has worked fine until lately.
On several occassions I have not been able to save the batch file after editing it (when it was connected to the laptop). If I change the name of the file (PC.bat to PC1.bat) I can save it. Also I append the log file each time I run it and even though I can save the batch file by changing the name I get an error when it is run because it can't write to the batch file. Again the way I fix this is to change the name of the batch file in the RoboCopy command line within the batch file. It's like the file has turned to read only at some point after it was created or used. This only happend randomly and I can not seem to figure out why. Any ideas would be appreciated.

----------------------------

#12 29 Feb 2008 19:02
Simon Sheppard


I've seen that behaviour from a virus scanner - it reads the executable batch file to scan it for viruses, but then leaves a lock on the file.

Usually a reboot and/or complete reinstall of the virus scanner will fix it.

----------------------------

#13 29 Feb 2008 19:36
drifty


Thanks I will take a look at this
Post Reply