(843) 324-5824Give a ReviewSupport PortalRequest Remote AssistanceRequest Remote Assistance
Gantry 5
  • Home
  • Services
      • Back
      • IT Services

      • IT Support
      • Computer & Network Consulting
      • Backup Solutions and Monitoring
      • Network Management and Monitoring
      • Cloud Email Setup & Migrations
      • Cloud Hosting & Network Setups
      • Small Business Network Evaluations
      • Small Business Training and Seminars
      • Back
      • Digital Marketing & Web Design Services 

      • Branding & Logo Design
      • Print & Digital Graphic Design
      • Web Design and Web Development
      • Reputation Management
      • Business Listings Management
      • Search Engine Optimization (SEO)
      • PPC Management
      • Social Media Management
      • Website and E-Mail Hosting
      • Blogging & Content Writing
      • Email Marketing
      • Back
      • Voice Over IP

      • VoIP Phone Installations
      • VoIP Maintenance & Support
      • VoIP Integrations
      • Call Center Setup & Management
      • Network Printing

      • Network Printing Setup
      • Network Printing Management & Support
  • Industry
      • Back
      • Medical
      • Service Based Businesses
      • Construction
      • Realty
      • Retail
      • Legal
      • Financial IT Services and IT Support in Charleston, SC
      • Manufacturing
  • Our Work
  • Careers
  • About Us
  • Get Started!

How to make a simple login script for Windows Server 2008, 2008r2, 2012, 2016

Creating a login script can be an easy way to solve network issues without active directory in a small network.  There are several common commands we have used over the years which help us map drives, add printers, copy files and folders, and more.  This page is a great guide made up from years of practice on different servers with different objectives.  We will add to it with more commands in the future.

First to know how to make a login script.  You have to make a notepad file and name it something like “login.bat”.  The easiest way to assign it to a user is to put the login.bat file in the “NETLOGON” part of the server share.  To find your NETLOGON folder, open the finder and navigate to your server.  You can do it either by IP address or by server name.  So //192.168.1.100 or //server would show you the network shares.  Make a text file there or make one in a spare drive and copy it there.  Remember, it has to be a .bat file.

Once you make the file, you can paste a few commands, here are some of our favorites:

@echo off – Turns off the command prompt when run.  It doesn’t give any feedback it is running.  Sometimes a big black command box popping up can confuse users.

net use * /delete /y – This deletes all existing drives, we do this to remove all existing drives if we are mapping new drives on a network, or if we add new information and change drive letters.  I leave this here as the Net Use command below will re-map the drives.

Net Use command:

net use S: \\server\Share Persistent:Yes – I always have one shared drive, typically I share this drive from the D or data drive of the server.  It will be shared with all network users.

net use L: \\server\Financial Persistent:Yes – There is normally a financial drive only shared with administrators of the business, make special permissions on the share to not share with all users, but only the people or group who needs access

net use k: \\server\Drake Persistent:Yes – Special software shares are typically shared with a domain user share setting to let any users of the domain access the software.  Never use the “Everyone” share as you don’t need a login to see it.

net use z: \\server\Scans Persistent:Yes – I always map a network scans folder.  Sometimes, there are usernames in the shared folder only the user can see.
net use P: \\server\Users\%username% Persistent:Yes – This will map a personal folder for the user to have their own stuff.
net use t: \\server\toolbox Persistent:Yes – For network administrators only, we share this with all computers so we have the software to do our jobs
net use q: “\\server\QB Data” Persistent:Yes – This can be shared with administrators, but in this case, we had a financial firm who used QB files for other businesses so we separated them.

xcopy t:\shortcuts\*.* “c:\Users\%username%\desktop” /D /E /C /R /I /K /Y  – We make a folder in the Toolbox or T drive named shortcuts.  This little gem copies anything in that folder to your user’s network desktop folder.  Quite nifty.  The extra letters at the end make sure it copies everything.

rem start \\192.168.1.100\sharp – The REM command is a command that “Comments” out information, or makes it where the script will not run that command, but it is not deleted.  Great for keeping something around which may be used later.

start \\192.168.1.100\xerox – The start command is great for mapping network printers.  First, you install a printer on the server, then you share the printer and name it, in this case the printer share is xerox.  Then you put this little piece of code in it, and it will install the printer on all computers with the login script.

We hope this helps, we’ve gone through many other forums and years of experience to put this together.  Happy coding!

Here is the script without the info:

@echo off

net use * /delete /y

net use S: \\server\Share
net use L: \\server\Financial
net use k: \\server\Drake
net use z: \\server\Scans
net use P: \\server\Users\%username% Persistent:Yes
net use t: \\server\toolbox
net use q: “\\server\QB Data” Persistent:Yes

xcopy t:\shortcuts\*.* “c:\Users\%username%\desktop” /D /E /C /R /I /K /Y

rem start \\192.168.1.100\sharp

rem start \\192.168.1.100\xerox

ABOUT THE ADVYON NAME

The name ADVYON was concieved from combining the words Advice and Beyond. When ADVYON was first conceptualized, it was to be a non profit company whose mission was to help other non profit companies with technology needs. Today, we have broadened our market to serve all. We still like to help others and have kept our core beliefs in helping our partners and community grow to build a better tomorrow.

GET IN TOUCH

    CONTACT INFO

    • (843) 324-5824
    • Advyon Consulting, LLC
      100 Seven Oaks Ln
      Summerville, SC 29485
    • Click For Directions
    • info@advyon.com
    • Give a Review
    © 2008 - 2023 ADVYON Business Technology Consulting