Link to home
Start Free TrialLog in
Avatar of drotkopf
drotkopfFlag for United States of America

asked on

How to Prevent SBS_LOGIN_SCRIPT.bat from Running on Domain Controller (SBS 2003)

How do I Prevent SBS_LOGIN_SCRIPT.bat from Running on Domain Controller (SBS 2003)?

Here's the thing. There are a couple of  mapped drives, P and Q (to \\myserver\blabla) that are accessible through their letters, but they don't appear on file explorer (or in DOS). The files do appear if I search by name, however I can't right click on them (I wanted to outsmart windows by Opening Containing Folder...)

The problem that this is creating is that I can't select those folders or anything in them in when selecting files for the backup set for our backup software, therefore... those files aren't being automatically backed up.

To be honest, I saw this https://www.experts-exchange.com/questions/22914795/Mapped-network-drives-do-not-appear-in-WIndows-explorer.html and didn't understand a thing. Just seeing VB script makes me tremble. I'm not a techie.

I tried unmapping the drives to the network paths, but it doesn't help - and if I logoff/login the script that maps them runs again.

Can I do something like IF 'this computer name is not such and such' THEN map the drive (but else don't) ?

Thanks!
Avatar of Rob Williams
Rob Williams
Flag of Canada image

If you are using one general batch file logon script (default with SBS) you can just add something like:

If "%ComputerName%" == "SBSname" Go To SKIPTO
rem lines you do not want to process on the SBS
net use X: \\Server\Share
:SKIPTO
rem rest of lines to be applied to all systems

[note %computername% is a variable do not change this, just change SBSname to your SBS name]

If drives are already mapped on the SBS you may have to disconnect them or run from a command line
net use * /persistent:no

This can all be controlled in group policy as well, but just adding the two lines to the batch file is simple.
Avatar of drotkopf

ASKER

RobWill - I had done something like that while waiting for the answer:

if not %computername% == CS01 NET USE P: \\cs01\Public_Directories

The script works great... but it didn't solve the underlying problem of not being able to navigate to the C:\Public_Directories folder using DOS or file explorer :-(

Ideas?
I appologize but I am not sure I understand fully.
Are you saying you cannot access using the UNC name \\server\share from a command line?
Or you cannot access using the mapped drive to the same folder?

You would be best to eliminate any drive mappings and recreate them on the server, for example

If Not "%computername%" == "CS01"  GoTo NEXT
Rem delete all existing mapped drive connections and recreate at each logon
Net Use  /persistent:no
Net Use  *  /delete
Net Use P: "\\cs01\Public_Directories"
:NEXT
 
RobWill-

Let's say that
- server name is S1
- folder is C:\F2 which is shared as N3
- I map Q: to \\S1\N3

a) I AM able to access using UNC name \\S1\N3 from a command line from all over the network and from the same server (DC) itself.

b) I AM also able to access it using the mapped drive (Q:), both from a command line or with Explorer navigation.

c) I AM NOT able, though, to access that folder C:\F2, not using explorer (I expand My Computer, I see C:, I expand C: and F2 does not appear!) and not through command line (C:, CD \, dir, it doesn't appear)

Thanks!
That sounds more like the 'hidden' attribute of that folder is enabled.
Try opening a command line and enter  C:
then enter   attrib F2
It should return  C:\F2
But if it returns     H   C:\F2  it is hidden.
To correct or make sure  run   attrib  C:\F2  -H

You can also do using the general tab of the folder properties, but I find the attrib command more dependable
The attributes that is comes back with are:
    SHR

When I run attrib C:\F2 -H it comes back with
    Not resetting system file - C:\F2

That makes me think that the S is telling me that the F2 folder is a system file.

Now, we are talking about users files in there like quickbooks files, word, excel, PDFs, etc.

So i have 2 questions:
1) Should I run attrib C:\F2 -S and what are the consequences of that?
2) Why if I have show hidden files and folders selected for these (and all other) folders, it still doesn't show them?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Rob Williams
Rob Williams
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
Thanks drotkopf. Glad to hear you were able to resolve.
Cheers!
--Rob