Solved

Windows Script Help - 2k3 Login.bat

Posted on 2007-03-29
5
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 67

Expert Comment

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

Author Comment

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

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18832985
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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…

738 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