Logon Scripts....


Recommended Posts

I have a logon script for every department in my office and basically it makes sure that the Anti-Virus is in place and also that all of the mapped drives are mounted. Currently, the way its setup is first...I make sure the drives are removed using the following command:

net use s: /del

net use f: /del

net use h: /del

net use j: /del

net use x: /del

net use z: /del

Then, I mount them

net use s: \\shire\apps

net use f: \\borg\rw

net use H: \\borg\%USERNAME%

net use J: \\borg\shared

net use x: \\10.1.16.20\groups foscht /user:bhs\tforscht

net use z: \\192.168.60.10\parts docs

For some reason, this configuration doesn't really work 100% of the time..I don't know what it is....but it doesnt. Is there a command I can issue before the mounting commands (the second set I listed above) that will remove all drives? OR Am I doing something wrong?

Please help!

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/
Share on other sites

things 2 think about

anything with a space in it like ur example of groups foscht should be enclosed with quotation marks - the space inbetween acts as a delimiter which is not what we want here.

secondly the some of the letters are in capitals - now i KNOW this shudnt make a lick of differnce but uniformity is the key to good troubleshooting.

also make sure u have routes or ip's that will make sure u can access thoes resources on thoes IP Addresses (IE make sure you can ping them)

Make sure u have appropriate ACL's to be able to access the resources - and as the users who will logging in using this script

Apart from that it should work no worries - however ur problem might not be with the script but with perhaps DNS or WINS - more likely dns if its a 2k + system.

If so then that is another kettle of fish ... let me know how you go.

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585113170
Share on other sites

You should use this probably.

@echo off
break off
cls
net use * /d /y >nul
net use s: \\shire\apps >nul
net use f: \\borg\rw >nul
net use H: \\borg\%USERNAME% >nul
net use J: \\borg\shared >nul
net use x: "\\10.1.16.20\groups foscht" /user:bhs\tforscht >nul
net use z: "\\192.168.60.10\parts docs" >nul

That will tidy things up a bit, but if you're finding that the script works *some* times then you need to look elsewhere.

More than likely it's the "Fast logon optimization" feature in Windows XP. That needs to be disabled on a network and also you need to force "always wait for network at logon"

Do you have a Windows 2000 or 2003 server and are all your clients XP?

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585113250
Share on other sites

You should use this probably.

@echo off
break off
cls
net use * /d /y >nul
net use s: \\shire\apps >nul
net use f: \\borg\rw >nul
net use H: \\borg\%USERNAME% >nul
net use J: \\borg\shared >nul
net use x: "\\10.1.16.20\groups foscht" /user:bhs\tforscht >nul
net use z: "\\192.168.60.10\parts docs" >nul

That will tidy things up a bit, but if you're finding that the script works *some* times then you need to look elsewhere.

More than likely it's the "Fast logon optimization" feature in Windows XP. That needs to be disabled on a network and also you need to force "always wait for network at logon"

Do you have a Windows 2000 or 2003 server and are all your clients XP?

585113250[/snapback]

WOW! Thank you so much! I will try this out immediately!

Edited by cultavix
Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585120007
Share on other sites

Actually, what happens is..the users create their own drives all across the network and that is where my problem is...So first, I wanted to figure out how to issue a command so that all of the drives are basically deleted everytime the machine logs on and then it adds the drives every session.

I attached my latest script above...I am getting errors about the network not being available or an error 67?

And yes, we have 4 networks

10.1.16*

192.168.60*

192.168.80*

192.168.85.*

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585120655
Share on other sites

Thanks Eversurf, I hadn't even noticed that.

Yes, cultavix, what you have there is a very unusal setup and to be honest is bound to be causing problems. I presume the different networks are down to security issues or the remains of old networks that haven't quite been removed fully yet.

If you post exactly what you have in terms of operating systems and the reason for the different networks then we may be able to point out improvements (or total network reconfiguration :p )

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585121418
Share on other sites

Cultavix,

if you want to launch the command at each log on you don't need to delete everything on start, you can delete the line with "net use * /d /y >nul" and instead add " /persistent:no" to all the other lines. This command allows you to disconnect network drives at each log off or restart. The thing should look like this:

@echo off
break off
cls
net use s: \\shire\apps /persistent:no >nul
net use f: \\borg\rw /persistent:no >nul
net use H: \\borg\%USERNAME% /persistent:no >nul
net use J: \\borg\shared /persistent:no >nul
net use x: "\\10.1.16.20\groups foscht" /user:bhs\tforscht /persistent:no >nul
net use z: "\\192.168.60.10\parts docs" /persistent:no >nul

hope this helps

BTW: I'm still searching for someone to help me with a Remote Installation problem with Windows 2003 :p

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585122238
Share on other sites

You should use this probably.

More than likely it's the "Fast logon optimization" feature in Windows XP. That needs to be disabled on a network and also you need to force "always wait for network at logon"

Do you have a Windows 2000 or 2003 server and are all your clients XP?

585113250[/snapback]

How does one disable Fast logon optimization in Windows XP? I disabled always wait for network at logon and Fast logon optimization is something I have never heard of.

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585122466
Share on other sites

How does one disable Fast logon optimization in Windows XP? I disabled always wait for network at logon and Fast logon optimization is something I have never heard of.

585122466[/snapback]

Sorry, I was rambling when I posted that. I should have said that you disable Fast logon optimization BY disabling "always wait for network at logon"

In the group policy it's at:

Computer Configuration \ Administrative Templates \ System \ Logon \

Always wait for the network at computer startup and logon

As the policy says - Xp doesn't wait for the network during logon unless you are using a romaing profile. You may notice that 'some' people don't get their mapped drives sometimes, this is usually the reason.

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585122528
Share on other sites

Thanks to everoyne for their input. I am going to test the script out. You can check out my final outcome, attached to this post.

Comment as you'd like...

NOTE: HAH. I couldnt upload the .bat file so....right click the image, save image to ur desktop or whatever, then rename it to .bat ;)

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585124792
Share on other sites

Well one quick impression is that the first two lines should be

@echo off

break off

They lose their use if they are put further down the script. @echo off stops all the lines off your script from being outputted to the screen while it's being run. Break off stops someone pressing "CTRL C" to cancel the script.

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585126747
Share on other sites

Also you have theses two lines:

@SET LANG=ENU
@SET FILE_SERVER=BORG

are they working how you want? You are setting environment variables there, but that only sets 'user' environment variables. If you want to set 'system' environment variables you'll need to use the resource kit file 'setx', you should be able to get it from Microsoft - PM me if you ca't get it. If it's working how you expect then that's fine, I know we've had problems with it before.

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585126763
Share on other sites

Here is your current logon script for others to see:

@SET LANG=ENU
@SET FILE_SERVER=BORG
@ECHO OFF

\\melkor\netinstall\logon\NILogin.cmd

net use * /delete /y

break off
cls
net use s: \\shire\apps /persistent:no >nul
net use f: \\borg\rw /persistent:no >nul
net use H: \\borg\%USERNAME% /persistent:no >nul
net use J: \\borg\shared /persistent:no >nul
net use x: "\\10.1.16.20\groups foscht" /user:bhs\tforscht /persistent:no >nul
net use z: "\\192.168.60.10\parts docs" /persistent:no >nul


rem %0\..\NBPSHPOP +T: \\BORG\vplogon

if "%OS%" == "Windows_NT" goto WINNT_NBPSHPOP

%0\..\NBPSHPOP +T: \\BORG\vplogon

goto MOVEON

:WINNT_NBPSHPOP

NBPSHPOP +T: \\BORG\vplogon

:MOVEON

T:\OSVER
IF ERRORLEVEL 2 GOTO WIN_32
GOTO 16BIT

REM *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

:WIN_32
   T:\VP_Log32 /p=T: 
   GOTO END

REM =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

:16BIT
   T:\VP_Log16 /l=%LANG% /p=T:\ /n=4

REM =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

:END

rem %0\..\NBPSHPOP -T:

if "%OS%" == "Windows_NT" goto WINNT_NBPSHPOP_END

%0\..\NBPSHPOP -T:

goto MOVEON_END

:WINNT_NBPSHPOP_END

NBPSHPOP -T:

:MOVEON_END


rem - Begin global mappings




rem - Begin global mappings

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585126802
Share on other sites

Do you use Windows 9x anywhere on your network? If so then

net use * /d /y

will cause the script to fail. 9x uses the Z: drive to connect to the logon folder in order to run the script (that's also why if you map a drive using Z: it will fail). So, if you have 9x the script will run from Z:, but if you have 'net use * /d /y' in your script that will disconnect all current drives including Z: meaning it can no longer read the remaining lines of the script. That one gave us some headaches I can tell you.

Link to comment
https://www.neowin.net/forum/topic/258024-logon-scripts/#findComment-585126808
Share on other sites

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

    • No registered users viewing this page.
  • Posts

    • Microsoft releases major feature updates for stock Windows 11 apps by Taras Buria In addition to releasing new Windows 11 preview builds, Microsoft announced that inbox Windows apps now have dedicated release notes in the official documentation. At long last, users have access to all the release notes for each app, with changes listed in chronological order. Microsoft used to announce feature updates for stock apps with each build. Now, with Windows Insider release notes hosted on the Microsoft Learn website, each app has a dedicated space for its changelog, which is very useful for those who want to track new features and improvements. Alongside that, Microsoft dropped massive feature updates for six stock apps: Clock, Media Player, Calculator, Voice Recorder, Photos, and Paint. Each app packs quite a lot of changes and new capabilities, so here are the release notes. Here are quick notes so that you can jump to the app you are interested in the most: Calculator Camera Clock Media Player Paint Photos Sound Recorder Here is what is new for the Calculator in version 11.2605.9.0: More accurate square-root results — Fixed rare cases where a calculation that should equal zero (like sqrt(2.25) - 1.5) returned a tiny leftover value instead. Readable text in High Contrast themes — Settings text now shows the correct colors in the High Contrast Aquatic and Desert themes. Fixed layout for right-to-left languages — For languages like Arabic and Hebrew, the graph, number pad, equation fields, and scroll buttons now appear correctly oriented. Reliable launch after upgrading — Fixed an issue where upgrading from much older versions could leave outdated settings that stopped the app from opening. Here is what is new for the Camera app (version 2026.2605.7.0): Zoom slider works on more cameras — The zoom slider now works on the latest cameras, respects your system zoom settings, and updates instantly when you change those settings. Full range of zoom levels — Fixed an issue where the zoom slider only showed three steps on some devices that zoom in finer increments. Front camera works on more devices — Resolved a problem that blocked the front-facing camera on certain wide-angle devices. More video resolution choices — You can now pick video resolutions that were previously hidden; the app shows a heads-up warning instead of removing them. QR links you can still use — When a scanned QR code points to something with no matching app, the link is now copied to your clipboard (with a notification) while still offering a Store search. Smarter default settings — When you haven't set a preference, the app now follows your system settings by default. The Clock app has a massive changelog with the following improvements in version 11.2605.9.0: Timers keep counting after they hit zero — When a timer runs out, it now keeps counting up (for example, -00:27:31) so you can see how far past the time you've gone. You can turn off the daily goal — Focus Sessions now include an "Off" option so you can skip setting a daily goal entirely. New 15-minute snooze option — Alarms now offer a 15-minute snooze interval. Run up to 3 countdowns at once — The Countdown Widget now supports three simultaneous countdowns, up from two. Timer Widget notifications now appear — Fixed an issue where the "timer finished" notification didn't show when the timer was started from the widget. Less clutter in Focus Sessions — Tasks you've already completed no longer show up in the Focus Session task list. More accurate focus progress — Fixed a rounding issue that could show your daily focus progress as a minute short (for example, 49 minutes instead of 50). Smoother World Clock comparisons — The World Clock compare page now loads dates as you scroll, so it feels more responsive. Up-to-date World Clock locations — Refreshed country and city names to match their current names. Correct sun and moon icons during midnight sun — Fixed an icon that wrongly showed a moon during all-day daylight in polar regions. Fixed back-button behavior in clock comparisons — Pressing back once now takes you back as expected, instead of jumping the date to 1926. Corrected the Newfoundland time zone — Newfoundland now uses the right time zone (St. John's). Disabled alarms stay looking disabled — Editing a turned-off alarm no longer makes it appear turned on. Cleaner timer cards — The expand button is now turned off on timer cards that have no time set, preventing actions that wouldn't do anything. Clearer theme setting — Updated the wording to "Choose your preferred app theme." Smoother Settings links — The "About" links in Settings no longer trigger an unexpected "switch apps" prompt. Fixed spacing in Spotify settings — Corrected uneven spacing in the Spotify settings card. Better focus visibility in High Contrast — The focus highlight in World Clock is now clearly visible in the High Contrast Aquatic and Desert themes. No more double announcements — Screen readers no longer read the timer value twice. Countdown names read correctly — Screen readers now properly announce the name of each countdown. Keyboard focus stays put — Focus no longer disappears after you press the Timer Reset button. Clearer alarm toggle for screen readers — Tidied up how the alarm on/off switch is announced. The Media Player app received plenty of changes as well (version 11.2605.14.0): Custom captions — You can now personalize how closed captions appear, with caption styling tied to your Windows caption settings, plus a quick link to open those settings directly. "Indexing" banner in the play queue — When your media library is still being scanned, a banner now explains why some items may not appear yet. Fixed the look of selected items — Corrected a layout glitch with selected items in lists. Fewer playback failures — Improved how the app recognizes supported file types, so more files play without issues. Playlists need a name — You can no longer accidentally save a playlist with a blank name. Cleaner look for empty playlists — Improved how a playlist appears when it has no items yet. More stable play queue edits — Fixed a crash that could happen when changing the play queue while the app was switching between sessions. Clearer "missing codec" message — Improved the dialog that appears when a file needs a codec you don't have, with clearer guidance on what to do. A big update is also available for Paint in version 11.2605.61.0: Adjustable eraser transparency — You can now control how transparent the eraser is. Cleaner stamp brush strokes — Fixed visible color shifts and artifacts when using stamp-style brushes. JPEG photos save in place — Opening a rotated JPEG and pressing Save now overwrites the original instead of unexpectedly prompting "Save As." No more crash on bad image files — Opening a damaged or invalid image, from within the app, by double click, or commandline, now shows a clear error message instead of closing the app. Classic selection behavior restored — The selection outline now hides while you move, resize, or rotate a selection, just like in classic Paint. Tidier AI image panel — Fixed missing spacing at the bottom of the AI image generation panel for a cleaner layout. Visible button hover in light theme — Toolbar split buttons now show a clear hover highlight in the light theme. Snappier toolbar — Streamlined how the ribbon lays out, giving a small speed boost at startup. Fewer background crashes — Fixed a crash that could happen while background tasks were finishing up. Stable app shutdown — Prevented rare crashes when closing the app. Fixed layer removal glitch — Deleting the active layer no longer leaves the layers list in an inconsistent state. Here is what is new in the Photos app (version 2026.11060.2004.0): AI watermarking — AI-generated or edited images can now carry a visible Copilot watermark. You choose Never, Always, or Ask Every Time in Settings, with a confirmation when saving. The watermarking is off by default in settings. Better viewing of small images and pixel art — Tiny images (like 16×16 pixel art) now zoom in far more to fill the screen and stay crisp instead of looking blurry. Select scanned text with the keyboard — When text is detected in an image, you can now navigate and select it using the arrow keys, Shift+Arrow, Home/End, and Ctrl+A, with a clear focus highlight. Fixed a crash in text recognition — Resolved a crash that could close Photos while detecting text in images; the app now recovers gracefully. Easier keyboard navigation — Tabbing through the navigation bar no longer stops on hidden controls, so it takes a single Tab to move past it instead of three. And finally, here is the Sound Recorder (version 11.2605.1.0): Waveform shows with Bluetooth mics — The live waveform now displays correctly when you record using a Bluetooth audio device. No more stray scrollbar — A non-working horizontal scrollbar no longer appears at the bottom of the waveform unless you've zoomed in. Mark button ready right away — The Mark button no longer looks grayed out until you hover over it after opening the app. Markers hidden for WAV files — Markers are now turned off for WAV recordings, since that format can't store them — so they're no longer lost silently. Smoother deleting — Quickly pressing Delete and Enter to remove several recordings in a row no longer triggers a "file doesn't exist" error. Fixed a memory issue — Resolved a memory leak that occurred each time a recording started. You can find all these changelogs in the official documentation here.
    • again, an article about Microsoft Edge and ridicules hater's comments
    • From this very same article: "For organizations that prefer a “more deliberate pace”, the Extended Stable channel remains an option."
    • Or every other browser, because they all behave the same, at least the mainstream ones. Firefox does exactly the same: background updates, restart to install them. Haters gotta hate, I guess.
  • Recent Achievements

    • Very Popular
      AndrewSteel earned a badge
      Very Popular
    • Veteran
      Taliseian went up a rank
      Veteran
    • One Month Later
      Clizby earned a badge
      One Month Later
    • One Month Later
      Timaximus earned a badge
      One Month Later
    • Week One Done
      Timaximus earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      493
    2. 2
      PsYcHoKiLLa
      167
    3. 3
      +Edouard
      162
    4. 4
      Steven P.
      85
    5. 5
      ATLien_0
      77
  • Tell a friend

    Love Neowin? Tell a friend!