Solved

Windows Script Help - 2k3 Login.bat

Posted on 2007-03-29
5
164 Views
Last Modified: 2010-04-16
My company has several different offices with applications that run from the local DCs and file servers.  I wrote a script to determine which branch a workstation was at and would process a login script accordingly.  The script seems to run most of the time, but there are a few sporatic workstations that either don’t run the script at all or run the wrong script.  Any and all improvements or recommendations would be greatly appreciated.

Thanks in advance.

Below are examples of the scripts I am using:

================================================
MAIN SCRIPT:

@ECHO OFF
CLS

if exist c:\site1.txt CALL //site1/SYSVOL/COMPANY.NET/SCRIPTS/site1.BAT GOTO EOF

if exist c:\site2.txt CALL //site2/SYSVOL/COMPANY.NET/SCRIPTS/site2.BAT GOTO EOF

if exist c:\site3.txt CALL //site3/SYSVOL/COMPANY.NET/SCRIPTS/site3.BAT GOTO EOF

if exist c:\site4.txt CALL //site4/SYSVOL/COMPANY.NET/SCRIPTS/site4.BAT  GOTO EOF

:EOF
EXIT

===================================================
SITE1 SCRIPT

@ECHO OFF
CLS

Net Time \\site1 /set /yes

rem *** Remove any existing mapped drives used in the logon script:
for %%a in (g n o p r s t u x) do net use %%a: /delete >nul 2>nul
rem *** Make drive mappings non-persistent:
net use /persistent:no

Net Use o: \\site1\documents\
Net Use u: \\site1\apps$\application
Net Use N: \\site1\apps$\

ipconfig >c:\site1.txt
echo ************************************** >>c:\site1.txt
echo ***%date%***%time%***%computername%***%username%*** >>c:\site1.txt
echo ************************************** >>c:\site1.txt

call \\site1\sysvol\company.net\scripts\site1Printer.vb

EXIT
0
Comment
Question by:AzagThothe
  • 2
5 Comments
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Perhaps it's permissions in that the user can't set the time on their system?
0
 

Author Comment

by:AzagThothe
Comment Utility
Domain users are part of the local admin group on every workstation.
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
Comment Utility
What about the policy though to prevent changing system time - is that somehow disabled for local users?
Start->Run->secpol.msc - under User Rights Assignment - who has access to change system time?

For testing also - I would try just the net time command on one of those workstations - note the results when run manually using that account.

You might also adjust your logon script temporarily - remove the @echo off (so you can see the processing) and place a pause after the net time /set - so that you can determine any errors...
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now