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

    • XFX 9060 XT 16 GB is $349 on Amazon (shipped & sold by Amazon) https://www.amazon.com/dp/B0F8...p;previewDohDeal=1&th=1 People - never trust any neowin deals posted - they are the worst at seeking deals, and just want to peddle their own to make a quick buck. It's disgusting.
    • It's a grey market key - proceed at your own risk. It's baffling that neowin supports this shady stuff.
    • Arc 1.57.0 by Razvan Serea ARC browser is finally here for Windows, bringing its unique and modern approach to browsing. With a clean interface and a powerful sidebar, ARC makes managing tabs and organizing your workflow a breeze. You can group tabs, pin important pages, and quickly switch between work and personal spaces without clutter. It’s designed to be fast, customizable, and genuinely useful, making it more than just a browser—it’s a productivity tool. If you’re on Windows and want a fresh way to browse and stay organized, ARC is worth checking out. ARC browser key features: Split View: Work with multiple tabs side by side in a single window for efficient multitasking. Tab Grouping: Organize tabs into customizable groups for better workflow management. Pinned Tabs: Keep essential pages permanently accessible in the sidebar. Spaces: Create separate workspaces for different projects or personal use, reducing clutter. Sidebar Integration: Access bookmarks, notes, and tools directly from the sidebar for quick navigation. Customizable Themes: Personalize the browser’s appearance with themes and color schemes. Quick Search: Find tabs, history, or bookmarks instantly with a powerful search bar. Lightning-Fast Performance: Built for speed with optimized resource usage and minimal lag. Built-in Note-Taking: Jot down ideas or save snippets directly within the browser. Focus Mode: Hide distractions and focus on a single tab or task. Cross-Device Syncing: Seamlessly sync your data across multiple devices for a unified experience. Keyboard Shortcuts: Boost productivity with customizable shortcuts for common actions. AI-Powered Suggestions: Get smart recommendations for tabs, bookmarks, and workflows. Privacy Controls: Built-in tools for blocking trackers and managing cookies for enhanced security. Extensions Support: Compatible with popular browser extensions to extend functionality. Arc Browser 1.57.0 release notes: ''Thanks as always for using Arc. This week's release includes a bump to Chromium 137.0.7151.69, which patched three security vulnerabilities. Enjoy!'' Download: Arc Browser 1.57.0 | 1.9 MB (Freeware) View: Arc Browser Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • they put useless AI, new plastick sticker 8K and price +$80 for nothing
    • this AD block popup in annoying
  • Recent Achievements

    • First Post
      Uranus_enjoyer earned a badge
      First Post
    • Week One Done
      Uranus_enjoyer earned a badge
      Week One Done
    • Week One Done
      jfam earned a badge
      Week One Done
    • First Post
      survivor303 earned a badge
      First Post
    • Week One Done
      CHUNWEI earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      427
    2. 2
      +FloatingFatMan
      237
    3. 3
      ATLien_0
      213
    4. 4
      snowy owl
      207
    5. 5
      Xenon
      159
  • Tell a friend

    Love Neowin? Tell a friend!