Recommended Posts

I am trying to create a login script that will map user drives based on the groups they belong to. I am using ifmember.exe from the Windows 2000 Resource Kit. However, it appears to be working on my XP box, but it's causing my 2000 box to lock up. This leads me to believe there is an error in the script. The Groups I have are CGS, DATABOOK, PROGRAMS and ADMINISTRATORS.

The script:

net use /persistent:no

ifmember CGS

if not errorlevel 1 goto SkipU

NET USE /User:dc1\%username% U: \\dc1\HOME$\%USERNAME%

if errorlevel 1 set LS_Error=%LS_Error% U (Home)

:SkipU

ifmember CGS

if not errorlevel 1 goto SkipM

NET USE /User:dc1\%username% M: \\dc1\GROUP$\public

if errorlevel 1 set LS_Error=%LS_Error% U (Home)

:SkipM

ifmember Databook

if not errorlevel 1 goto SkipN

NET USE /User:dc1\%username% N: \\dc1\GROUP$\databook

if errorlevel 1 set LS_Error=%LS_Error% N (DATABOOK)

:SkipN

ifmember Programs

if not errorlevel 1 goto SkipO

NET USE /User:dc1\%username% O: \\dc1\Programs$

if errorlevel 1 set LS_Error=%LS_Error% O (PROGRAMS)

:SkipO

ifmember Administrators

if not errorlevel 1 goto SkipQ

NET USE /User:dc1\%username% Q: \\dc1\Software$\Apps

if errorlevel 1 set LS_Error=%LS_Error% Q (APPS)

I am not sure what the persistance tag means at the begining or the ir error the "if errorlevel 1 set LS_Error=%LS_Error%" line in the script means. So, if someone could explain those, I would appreciate it.

Link to comment
https://www.neowin.net/forum/topic/83939-login-script-problems/
Share on other sites

persistent tag simply allows you to re-establish the network connected shares for a user when they log in into your network.....this is set to either yes or no....and I think you know that part already....the errorlevel line allows a way for you to gracefully exist the script if your users don't meet the conditions set forth by which groups the user belongs to...if they do meet the conditon...it goes about allowing the user to gain access to set shares...

hmmmm...not sure...but you say that it locks up your W2K system....so you mean to say that you actually SEE the script execute when logging in....but it FREEZES at that point...so you see the login script dialog box forzen on your screen?....and that leave no alternative but to reboot?

...it happened to me when I migrated an NT 4.0 box to W2K and it caused the scripts to be unavailable...

You're not setting the variable for the LS_Error parameter

On your NET USE line you have "/User:dc1\%username%", you shouldn't need to specify the user since it will use the current account unless specified otherwise (I could see using it if you wanted to map with a different account name)

In the "ifmember Administrators" section you have "if not errorlevel 1 goto SkipQ" but don't have a "SkipQ" defined (guessing you just missed pasting it?)

This link should get you running:

http://www.experts-exchange.com/Operating_...Q_20420238.html

Thanks guys, I got it working. It turns out it was freezing because the profile had someone got corrupt. I deleted the profile and it worked fine. I did change the script a little, don't use the one I pasted for reference. PM me if you need help and I will do my best.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • The long-awaited Nothing Phone (3) is finally coming next month, launch date confirmed by Aditya Tiwari London-based consumer electronics brand Nothing is due to launch its latest flagship in 2025. The company dropped a new teaser for the Phone (3), revealing when the flagship device will be out on the market. Nothing Phone (3) will be unveiled during a live event on July 1 at 1:00 PM ET / 10:00 AM PT / 6:00 PM BST / 11:30 PM IST. It has already created a live event titled "Come to Play" on its official YouTube channel, for which you can add a reminder by clicking on the "Notify Me" button. Nothing CEO Carl Pei has previously dropped several details about the unreleased smartphone. He took part in a social media AMA earlier this year and said Nothing Phone (3) will arrive in the third quarter of 2025. Pei confirmed that Nothing Phone (3) will make its way to the US this time after a dry spell since 2023. However, he didn't specify whether the device will be sold directly or through the beta channel, which currently includes Phone (3a), Phone (3a) Pro, and CMF Phone 2 Pro. The US has been a rocky terrain for Nothing. Its first smartphone was made available through the beta channel, and the Nothing Phone (2) is the only smartphone from the company that has been widely available in the US. The Glyph interface featured on the back of Nothing smartphones has remained a differentiating factor from the start. However, the smartphone maker recently posted a 9-second video in which the Glyph lights on the back of a Nothing smartphone abruptly turn off. "We killed the Glyph Interface," the company said. It makes sense when you check out the Phone (3) teaser and see dot matrix-style lights being flashed in a pattern. Nothing released another teaser about a week ago, featuring the number 3 lit up as dot matrix LEDs. If you're looking for some trivia, Nothing product manager Raymond Zhu estimated in a Q&A video that the company would need to sell about 250,000 Phone (3) units to turn a profit. Answering another question, he added that their biggest weakness is "no one knows us", and the company is struggling to reach the masses without high marketing budgets. Let's wait to see what Nothing has in store for Phone (3) next month other than the new physical button. Speaking of the future of smartphones, the Nothing CEO believes that our entire software experience will eventually be condensed down to just one app.
    • As far as I can remember, no one has done a 4v4 before. 2v2? yes. 3v3? yes.
    • I just checked with Brave portable, the shield is disabled, as well as uBlock Origin Lite, no change to the Host file, and no pop-up when I connect to the site 😵! I think this might be the best option? I don't have a Paypal account, because I got rid of it, and I was fed up with all the phishing attempts, so I use my credit card. Do you take credit card payments? Because so far it's been safer, no phishing attempts.    
    • *facepalm* Good sir... holy smokes. ...anyways I assume Qanba and the rest will also produce options in the near future.
  • Recent Achievements

    • Week One Done
      jbatch earned a badge
      Week One Done
    • First Post
      Yianis earned a badge
      First Post
    • Rookie
      GTRoberts went up a rank
      Rookie
    • First Post
      James courage Tabla earned a badge
      First Post
    • Reacting Well
      James courage Tabla earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      403
    2. 2
      +FloatingFatMan
      179
    3. 3
      snowy owl
      174
    4. 4
      ATLien_0
      170
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!